Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ZarrinPour
Yak Posting Veteran
66 Posts |
Posted - 2007-10-07 : 15:56:09
|
| Hi allImagine we have a table as follow:Create Table Test( Pkey int not Null identity Primary Key, Name varchar(20) not null, Famil varchar(30) not null)now is there anyway to Run following Script:declare @FLDName varchar(10)set @FLDName='Name'Select @FLDName from Testin the other hand is there anyway to use Local variables in a SELECT statements as above?to tell you the truth , what really motivated me to do this , was being able to declare a User-Defined-Function and passing some fields as an String and then use them in a SELECT statement or any other T-Sql codes!!!Could anyone help me.?Kind Regards. |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
|
|
|
|
|