|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to pass column name trough a parameter
Hello ,please help me
Is it possible to pass a column name through a parameter something like this create procedure dbo.paramerers @parameter varchar as select @parameter from table1 where.... because it doesn't give me an error but it also doesn't work |
|
#2
|
||||
|
||||
|
Quote:
try Exec('select ' + @parameter + ' from table1') it worked before because you're selecting a value itself, basically you're not selecting any real fields from the table. Al |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > How to pass column name trough a parameter |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|