随笔分类 - SQL
摘要:declare @name varchar(50);declare @ALTER varchar(50);SET @ALTER = ' ALTER TABLE ';declare @CONSTRAINT varchar(50);SET @CONSTRAINT = ' ADD CONSTRAINT '
阅读全文
摘要:--ImplusDb数据库 use [ImplusDb]go declare @name varchar(50);declare @STMT nvarchar(max) -- SQL to executedeclare cur_data SCROLL cursor forselect distinc
阅读全文
摘要:declare @id int,@value nvarchar(100); begin declare c_test_main cursor fast_forward for select hps_hpId,hps_time from hospitalPermSupp where hps_usId=1; open c_test_main;--打开游标 while 1...
阅读全文
摘要:取当前时间: 取前一个月的时间: 取年份: 取月份:
阅读全文
摘要:select RAWTOHEX(id) Id from t_cross insert into t_cross (ID) values ('HEXTORAW('" + cross["Id"] + "')' )
阅读全文
摘要:1. 当前系统日期、时间select getdate() 2. dateadd 在向指定日期加上一段时间的基础上,返回新的 datetime 值例如:向日期加上2天select dateadd(day,2,'2004-10-15') --返回:2004-10-1700:00:00.0003. dat
阅读全文