随笔分类 -  SQL

摘要:declare @name varchar(50);declare @ALTER varchar(50);SET @ALTER = ' ALTER TABLE ';declare @CONSTRAINT varchar(50);SET @CONSTRAINT = ' ADD CONSTRAINT ' 阅读全文
posted @ 2021-03-26 17:03 筱老邪 阅读(309) 评论(0) 推荐(0) 编辑
摘要:--ImplusDb数据库 use [ImplusDb]go declare @name varchar(50);declare @STMT nvarchar(max) -- SQL to executedeclare cur_data SCROLL cursor forselect distinc 阅读全文
posted @ 2020-10-23 15:35 筱老邪 阅读(320) 评论(0) 推荐(0) 编辑
摘要: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... 阅读全文
posted @ 2019-05-16 14:26 筱老邪 阅读(183) 评论(0) 推荐(0) 编辑
摘要:取当前时间: 取前一个月的时间: 取年份: 取月份: 阅读全文
posted @ 2019-05-16 14:25 筱老邪 阅读(169) 评论(0) 推荐(0) 编辑
摘要:select RAWTOHEX(id) Id from t_cross insert into t_cross (ID) values ('HEXTORAW('" + cross["Id"] + "')' ) 阅读全文
posted @ 2015-07-24 18:20 筱老邪 阅读(242) 评论(0) 推荐(0) 编辑
摘要:1. 当前系统日期、时间select getdate() 2. dateadd 在向指定日期加上一段时间的基础上,返回新的 datetime 值例如:向日期加上2天select dateadd(day,2,'2004-10-15') --返回:2004-10-1700:00:00.0003. dat 阅读全文
posted @ 2013-11-13 11:21 筱老邪 阅读(237) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示