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.0Can anyone help please? Thanks in advance Scott
The syntax is correct - but you cannot have a GO statement inside a proc.
精彩评论