随笔分类 -  SQL Server

摘要:If you run into the following error message: An explicit value for the identity column in table ‘’ can only be specified when a column list is used and IDENTITY_INSERT is ON. It can mean two thi... 阅读全文
posted @ 2014-03-11 14:37 DukeCheng 阅读(8290) 评论(0) 推荐(0) 编辑
摘要:WITH cte AS ( SELECT roleid,permissionid, row_number() OVER(PARTITION BY roleid,permissionid ORDER BY roleid,permissionid) AS [rn] FROM rolepermissionrecords ) DELETE cte WHERE ... 阅读全文
posted @ 2014-03-07 12:29 DukeCheng 阅读(175) 评论(0) 推荐(0) 编辑
摘要:The easiest way to create a copy of a table is to use a Transact-SQL command. Use SELECT INTO to extract all the rows from an existing table into the new table. The new table must not exist already. T... 阅读全文
posted @ 2014-03-01 15:59 DukeCheng 阅读(270) 评论(0) 推荐(0) 编辑
摘要:Example 1 : (Fetch clause must be greater than zero) USE AdventureWorks2012 GO SELECT * FROM [HumanResources].[vEmployee] ORDER BY [JobTitle] OFFSET 10 ROWS FETCH NEXT 0 ROWS ONLY --OUTPUT Msg... 阅读全文
posted @ 2014-02-15 17:52 DukeCheng 阅读(1961) 评论(0) 推荐(0) 编辑
摘要:USE [master];GOCREATE DATABASE test;GOCREATE DATABASE test2;GOBACKUP DATABASE test TO DISK = 'c:\temp\test.bak' WITH INIT, COMPRESSION;GORESTORE DATABASE test2 FROM DISK = 'c:\temp\test.bak' WITH RE... 阅读全文
posted @ 2014-02-14 17:35 DukeCheng 阅读(185) 评论(0) 推荐(0) 编辑

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