脚踏实地、勇往直前!
全部博文(1005)
发布时间:2014-08-03 15:05:36
1.返回表中的记录数CREATE procedure sp_table_count(@pi_table_name varchar(64)) asDECLARE @l_select_sql nvarchar(1000)DECLARE @count intSET @l_select_sql = 'select @c=count(1) from ' + @pi_table_name EXEC sp_executesql @l_select_sql, N'@c int output', @count OUTPUT .........【阅读全文】
发布时间:2012-12-15 10:40:09
环境: OS:Windows 2003 DB:SQL 20008 -- 创建备份表 select * into tb_test_bak from tb_test where 1=2; -- 定义游标 declare cur_data cursor for select id,name from hxl.dbo.tb_test; 通过游标将数据备份到备份表--打开游标open cur_data--申明变量接收游标取得值,游标读取的表有几个字段你就要申明几个变量去接收declare @id varchar(50)declare @nam......【阅读全文】
发布时间:2012-12-09 18:49:11
环境:
OS:Windows 2003
DB:MSSQL 2008
----------------------------------备份-----------------------------------------
1.完整备份hxl数据库
BACKUP DATABASE [hxl] TO DISK = N'D:\mssql_bak\hxl_bak20121210.bak' WITH NOFORMAT, NOINIT, NAME = N'hxl-完整 数据库 备份', SKIP, NOREWIND, NOUNLOAD, ST......【阅读全文】