随笔分类 -  Sql Server

摘要:select ROW_NUMBER() over( order by sort_id asc) as rows,* into #tmp_tbfrom tb_district其中sort_id为您原表的排序列。tb_district为要操作的表。 阅读全文
posted @ 2013-04-03 13:57 A light heart lives long 阅读(351) 评论(0) 推荐(0) 编辑
摘要:Create table Tab([Col1] int,[Col2] nvarchar(1)) Insert Tabselect 1,N'a' union all select 1,N'b' union all select 1,N'c' union all select 2,N'd' union all select 2,N'e' union all select 3,N'f' Go create function F_Str(@Col1 int) returns nvarchar(100) as 阅读全文
posted @ 2012-03-16 10:55 A light heart lives long 阅读(5554) 评论(1) 推荐(1) 编辑
摘要:exec sp_configure 'show advanced options',1 RECONFIGURE WITH OVERRIDE go exec sp_configure 'database mail xps',1 RECONFIGURE WITH OVERRIDE go --2.创建邮件帐户信息 EXEC msdb..sysmail_add_account_sp @ACCOUNT_NAME ='ETLErrorMailLog', -- 邮件帐户名称 @EMAIL_ADDRESS ='******@126.com' , 阅读全文
posted @ 2012-02-08 13:20 A light heart lives long 阅读(4218) 评论(2) 推荐(1) 编辑

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