|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Wednesday, December 05, 2012 11:31 AM
Points: 74,
Visits: 164
|
|
how to add # special character in a string @mysql that will be used by exec @mysql Hello all I have a temporary table used in pivoting so how to include #temp1 inside var @mysql that will be used in exec @mysql
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Saturday, May 18, 2013 6:46 PM
Points: 1,074,
Visits: 1,076
|
|
declare @mysql varchar (1000)='create table #team1(a int); select * from #team1' exec (@mysql) I am not sure what you are looking for, but for # you don't need to do anything special. one more thing, once this is executed there won't be any temp table to work on furthur.
declare @mysql varchar (1000)='create table #team1(a int); select * from #team1' exec (@mysql) select * from #team1
/* (0 row(s) affected)
(1 row(s) affected) Msg 208, Level 16, State 0, Line 3 Invalid object name '#team1'.*/
~ demonfox ___________________________________________________________________ Wondering what I would do next , when I am done with this one
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Wednesday, December 05, 2012 11:31 AM
Points: 74,
Visits: 164
|
|
|
|
|