摘要: 动态sql语句基本语法 1 :普通SQL语句可以用Exec执行 eg: Select * from tableName Exec('select * from tableName') Exec sp_executesql N'select * from tableName' -- 请注意字符串前一定要加N 2:字段名,表名,数据库名之类作为变量时,必须用动态SQL eg: de... 阅读全文
posted @ 2008-03-07 17:17 zhengguoqing 阅读(322) 评论(0) 推荐(0) 编辑
摘要: private bool SendMail(string systemEmail, string emailAddress, string subject, string body, bool isBodyHtml) { try { MailMessage message = new MailMessage(systemEm... 阅读全文
posted @ 2008-03-07 17:11 zhengguoqing 阅读(276) 评论(0) 推荐(0) 编辑
摘要: while patindex('%,%',@pid)>0 begin set @pid_after=substring(@pid,PATINDEX('%,%',@pid)+1,len(@pid)) set @p=substring(@pid,0,len(@pid)-len(@pid_after)) set @strSQL='update +' set +'=getdate(),'+@s... 阅读全文
posted @ 2008-03-07 17:08 zhengguoqing 阅读(337) 评论(0) 推荐(0) 编辑
摘要: CREATE TABLE [test] ( [id] [int] IDENTITY (1, 1) NOT NULL , [a] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [b] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL , [c] [varchar] (50) COLLATE Chine... 阅读全文
posted @ 2008-03-07 16:44 zhengguoqing 阅读(249) 评论(0) 推荐(0) 编辑
摘要: select round(convert(numeric(6,2),23.2346),2) select Convert(decimal(10,2),23.2346) 阅读全文
posted @ 2008-03-07 16:42 zhengguoqing 阅读(205) 评论(0) 推荐(0) 编辑