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 |
shanmugaraj
Posting Yak Master
219 Posts |
Posted - 2013-04-23 : 06:17:36
|
i need to have the column name column comming from the parameteri am unable to pass the parameter in my select query belowdeclare @column_name varchar(50)set @column_name = 'format_type_name'select + @column_name + from Format_typeTHANKSSHANMUGARAJnshanmugaraj@gmail.com |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-04-23 : 06:54:53
|
declare @column_name varchar(50)set @column_name = 'format_type_name'DECLARE @sql VARCHAR(500) = 'select '+ @column_name +' from Format_type 'EXEC (@sql)--Chandu |
|
|
shanmugaraj
Posting Yak Master
219 Posts |
Posted - 2013-04-23 : 07:04:35
|
is it possible to create the select query without using DECLARE @sql VARCHAR(500) =THANKSSHANMUGARAJnshanmugaraj@gmail.com |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-04-23 : 07:23:39
|
declare @column_name varchar(50)set @column_name = 'format_type_name'EXEC( 'select '+ @column_name +' from Format_type ')--Chandu |
|
|
|
|
|