开发者

EXECUTE AS on truncate sproc - Incorrect syntax

I'm getting an Incorrect syntax when trying to create a stored procedure to truncate a table then reseed it. Here's m开发者_运维技巧y code

    CREATE PROCEDURE [dbo].[_TransportZipporah_Purge]

WITH EXECUTE AS owner
AS
TRUNCATE TABLE [dbo].[*tablename*];
GO
 DBCC CHECKIDENT ('dbo.*tablename*', RESEED, 0);

As i have got this direct from MSDN I would have thought it would be correct.

Database server i'm using is : SQL Server 2008 v10.0.4064.0

Can anyone help please? Thanks in advance Scott


The syntax is correct - but you cannot have a GO statement inside a proc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜