• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • MsSql
  • Mysql
  • oracle
  • MariaDB
  • DB2
  • SQLite
  • PostgreSQL
  • MongoDB
  • Redis
  • Access
  • 数据库其它
  • sybase
  • HBase
您的位置:首页 > 数据库 >Mysql > 创建动态MSSQL数据库表

创建动态MSSQL数据库表

作者:匿名 字体:[增加 减小] 来源:互联网 时间:2018-12-05

匿名通过本文主要向大家介绍了动态,MSSQL,数据库等相关知识,希望本文的分享对您有所帮助

下面是利用SQL语句创建数据库、表、存储过程、视图、索引、规则、修改表、查看数据等的方法。

以下是引用片段:
代码如下:
  ImportsSystem.Data
  ImportsSystem.Data.SqlClient
  PublicClassForm1
  InheritsSystem.Windows.Forms.Form
  PrivateConnectionStringAsString="DataSource=.;InitialCatalog=;UserId=sa;Password=;"
  PrivatereaderAsSqlDataReader=Nothing
  PrivateconnAsSqlConnection=Nothing
  PrivatecmdAsSqlCommand=Nothing
  PrivateAlterTableBtnAsSystem.Windows.Forms.Button
  PrivatesqlAsString=Nothing
  PrivateCreateOthersBtnAsSystem.Windows.Forms.Button
  #Region"Windows窗体设计器生成的代码"
  '窗体重写处置以清理组件列表。
  ProtectedOverloadsOverridesSubDispose(ByValdisposingAsBoolean)
  IfdisposingThen
  IfNot(componentsIsNothing)Then
  components.Dispose()
  EndIf
  EndIf
  MyBase.Dispose(disposing)
  EndSub
  PublicSubNew()
  MyBase.New()
  InitializeComponent()
  EndSub
  PrivatecomponentsAsSystem.ComponentModel.IContainer
  FriendWithEventsDataGrid1AsSystem.Windows.Forms.DataGrid
  FriendWithEventsCreateDBBtnAsSystem.Windows.Forms.Button
  FriendWithEventsCreateTableBtnAsSystem.Windows.Forms.Button
  FriendWithEventsCreateSPBtnAsSystem.Windows.Forms.Button
  FriendWithEventsCreateViewBtnAsSystem.Windows.Forms.Button
  FriendWithEventsbtnAlterTableAsSystem.Windows.Forms.Button
  FriendWithEventsbtnCreateOthersAsSystem.Windows.Forms.Button
  FriendWithEventsbtnDropTableAsSystem.Windows.Forms.Button
  FriendWithEventsbtnViewDataAsSystem.Windows.Forms.Button
  FriendWithEventsbtnViewSPAsSystem.Windows.Forms.Button
  FriendWithEventsbtnViewViewAsSystem.Windows.Forms.Button
  PrivateSubInitializeComponent()


   代码如下:
Me.CreateDBBtn=NewSystem.Windows.Forms.Button()
  Me.CreateTableBtn=NewSystem.Windows.Forms.Button()
  Me.CreateSPBtn=NewSystem.Windows.Forms.Button()
  Me.CreateViewBtn=NewSystem.Windows.Forms.Button()
  Me.btnAlterTable=NewSystem.Windows.Forms.Button()
  Me.btnCreateOthers=NewSystem.Windows.Forms.Button()
  Me.btnDropTable=NewSystem.Windows.Forms.Button()
  Me.btnViewData=NewSystem.Windows.Forms.Button()
  Me.btnViewSP=NewSystem.Windows.Forms.Button()
  Me.btnViewView=NewSystem.Windows.Forms.Button()
  Me.DataGrid1=NewSystem.Windows.Forms.DataGrid()
  CType(Me.DataGrid1,System.ComponentModel.ISupportInitialize).BeginInit()
  Me.SuspendLayout()
  '
  'CreateDBBtn
  '
  Me.CreateDBBtn.Location=NewSystem.Drawing.Point(19,9)
  Me.CreateDBBtn.Name="CreateDBBtn"
  Me.CreateDBBtn.Size=NewSystem.Drawing.Size(104,23)
  Me.CreateDBBtn.TabIndex=0
  Me.CreateDBBtn.Text="创建数据库"
  '
  'CreateTableBtn
  '
  Me.CreateTableBtn.Location=NewSystem.Drawing.Point(139,9)
  Me.CreateTableBtn.Name="CreateTableBtn"
  Me.CreateTableBtn.TabIndex=1
  Me.CreateTableBtn.Text="创建表"
  '
  'CreateSPBtn
  '
  Me.CreateSPBtn.Location=NewSystem.Drawing.Point(230,9)
  Me.CreateSPBtn.Name="CreateSPBtn"
  Me.CreateSPBtn.Size=NewSystem.Drawing.Size(104,23)
  Me.CreateSPBtn.TabIndex=2
  Me.CreateSPBtn.Text="创建存储过程"
  '
  'CreateViewBtn
  '
  Me.CreateViewBtn.Location=NewSystem.Drawing.Point(350,9)
  Me.CreateViewBtn.Name="CreateViewBtn"
  Me.CreateViewBtn.TabIndex=3中国网管联盟www.bitscn.com
  Me.CreateViewBtn.Text="创建视图"
  '
  'btnAlterTable
  '
  Me.btnAlterTable.Location=NewSystem.Drawing.Point(441,9)
  Me.btnAlterTable.Name="btnAlterTable"
  Me.btnAlterTable.TabIndex=4
  Me.btnAlterTable.Text="修改表"
分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • MySQL动态创建表,数据分表的存储过程
  • mysql 显示SQL语句执行时间的代码
  • mysql 动态生成测试数据
  • mysql 动态执行存储过程语句
  • 讲解SQL Server执行相关动态SQL的正确方式
  • MySQL入门之动态SQL工具实现
  • 加速PHP动态网站 MySQL索引分析和优化
  • Oracle9i 动态SGA,PGA特性探索
  • 动态SQL中返回数值的实现代码
  • sqlserver 动态创建临时表的语句分享

相关文章

  • 2018-12-05MySQL之——JDBC 实现Master Slave
  • 2018-12-05MySQL命令行导出与导入数据库_MySQL
  • 2018-12-05MySQL 备份还原数据库批处理
  • 2018-12-05sql 分组查询问题
  • 2018-12-05MySQL · 引擎特性 · InnoDB IO子系统的详细介绍
  • 2018-12-05详细介绍SQL编程的一些良好好习惯
  • 2018-12-05mssql中获取指定日期所在月份的第一天的代码
  • 2017-05-11mysql启动服务报1058错误的解决方法
  • 2018-12-05利用windows任务计划实现oracle的定期备份
  • 2018-12-05【MySQL数据库】第四章解读:Schema与数据类型优化(下)

文章分类

  • MsSql
  • Mysql
  • oracle
  • MariaDB
  • DB2
  • SQLite
  • PostgreSQL
  • MongoDB
  • Redis
  • Access
  • 数据库其它
  • sybase
  • HBase

最近更新的内容

    • MySQL无GROUP BY直接HAVING返回空的问题分析
    • MySQL数据库的基本操作命令
    • Mysql 建库建表技巧分享
    • 一些常用的mysql优化方法总结
    • 使用mysql中遇到的几个问题
    • MySQL动态创建表,数据分表的存储过程
    • 关于SQLServer2005的学习笔记 XML的处理
    • mysql 左,右,内连接
    • SQL Server日志过大会影响查询结果
    • MySQL的23个需要注意的地方

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有