Tech Spot
.Net, C#, SQL, BI and much more......
Thursday, October 21, 2010
Dynamically Pass a Table Name to TRUNCATE TABLE
GO
DECLARE @tbl varchar(30) = 'YourTableName'
DECLARE @dynSQL varchar(50)
SET @dynSQL = 'TRUNCATE TABLE ' + @tbl
EXEC (@dynSQL)
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment