Erro creating procedure oneligne ok two ligne errors!!

  • try using dynamic sql for your alter query

    declare @sql nvarchar(max)

    set @sql = 'ALTER DATABASE '+@TableName+' SET SINGLE_USER WITH ROLLBACK IMMEDIATE;'

    exec sp_executesql @sql;

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

Viewing post 1 (of 2 total)

You must be logged in to reply to this topic. Login to reply