Oct 17, 2007 #1 mpruett Programmer Jul 22, 2005 13 US I'm trying to execute a command I've strung together into a string; I have something like this: declare @Name varchar(255) set @name = 'sp_rename ''test_table'',''test_table_2''' I want to execute the sp_rename statement held in @name. How do I do that?
I'm trying to execute a command I've strung together into a string; I have something like this: declare @Name varchar(255) set @name = 'sp_rename ''test_table'',''test_table_2''' I want to execute the sp_rename statement held in @name. How do I do that?
Oct 17, 2007 #2 gmmastros Programmer Feb 15, 2005 14,904 US declare @Name varchar(255) set @name = 'sp_rename ''test_table'',''test_table_2''' [!]Exec (@Name)[/!] -George "The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom Upvote 0 Downvote
declare @Name varchar(255) set @name = 'sp_rename ''test_table'',''test_table_2''' [!]Exec (@Name)[/!] -George "The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom