Why was this T-SQL Syntax never implemented?
Posted
by ChrisA
on Stack Overflow
See other posts from Stack Overflow
or by ChrisA
Published on 2010-05-19T07:10:04Z
Indexed on
2010/05/19
7:20 UTC
Read the original article
Hit count: 208
Why did they never let us do this sort of thing:
Create Proc RunParameterisedSelect
@tableName varchar(100),
@columnName varchar(100),
@value varchar(100)
as
select * from @tableName
where @columnName = @value
You can use @value
as a parameter, obviously, and you can achieve the whole thing with dynamic SQL, but creating it is invariably a pain.
So why didn't they make it part of the language in some way, rather than forcing you to EXEC(@sql)
?
© Stack Overflow or respective owner