|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Doubt declare SQLServer
I'd like to know, if there is a possibility reference declare SQLServer dynamically?
For example, I've tried execute this query(under), but I received this message (Server: Msg 137, Level 15, State 1, Line 6 Must declare the variable '@t1'.): declare @Frase varchar(50) set @Frase = 'declare @t1 varchar(10), @t2 int' exec (@Frase) select @t1 = 'AAAAA' select @t2 = 1000 Print @t1 Print @t2 I need to do this because 1) I get informations about specific table (sysobjects and syscolumns); 2) In relation to these columns I'll create a declare to use with a cursor, but unfortunately I can't. Thanks. |
|
#2
|
||||
|
||||
|
why don't you just declare the variables instead of trying to exec a statement?
__________________
My brain cells are like a storm trooper's armor: useless |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Doubt declare SQLServer |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|