I am trying to write a small stored procedure that accepts a table name as a paramater then uses the paramater as a variable and truncate the data that is in the table. Here is the procedure I have.CREATE PROCEDURE [dbo].[qryTruncateTable]@txtTableName nvarchar(25)ASTRUNCATE TABLE @txtTableNameGO
I am getting this error when I try to parse the query.Server: Msg 170, Level 15, State 1, Procedure qryTruncateTable, Line 7Line 7: Incorrect syntax near '@txtTableName'.
Can anybody help me out with the syntax i need to be able to perform this action?ThanksAlways look on the bright side of life, ta dum, ta dum.Monthy Python, The Life of Brian