常用命令 变量 1.声明 declare @变量名 类型,… 2.赋值 1.同时赋值多个变量(可以结合查询) select @变量名=表达式1,表达式2 2.单个赋值(推荐) set @变量名=表达式 3.显示 1.直接显示 print @变量名 2.以表格形式显示 select @变量名1,变量名 Read More
posted @ 2018-12-28 18:02 宝宝的大叔 Views(135) Comments(0) Diggs(0) Edit
非select命令 数据库 1.创建 //create database 库名 2.删除 //drop database 库名,... 2.重命名//exec sp_renamedb '库名','新库名' 表 1.创建 //create table 表名 (列名 类型,...) 2.删除 //dro Read More
posted @ 2018-12-28 17:51 宝宝的大叔 Views(461) Comments(1) Diggs(0) Edit
C#操作SQL数据库 Connection(连接)对象 形式2.”server=;Intergrated Security=true/SSPI” Command(命令)对象 形式2.new SqlCommand(Sql语句, 连接对象)//省略2,5 形式2.执行select语句(count,sum Read More
posted @ 2018-12-27 20:31 宝宝的大叔 Views(661) Comments(0) Diggs(0) Edit