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 |
|
legacyvbc
Starting Member
37 Posts |
Posted - 2007-08-23 : 12:04:52
|
| Ok, I cannot figure this out but it can't be that hard. I must be missing something. I am trying to create a stored procedure that updates a specific cell in a table according to the column heading and the index number. The problem is that I would like the column heading to be a parameter.To better explain here is a basic example of what I am trying to do:Table looks like thisDate, Car, House8/23/2007, 25, 2008/1/2007, 20, 3007/15/2007, 22, 250I would like a sp that will take two parameters @column_name and @date and will return the value of that particular cell:select @column_name from tblTable where date=@dateI'm sure I am missing something and this is a very basic example but I have spent way too much time trying to figure this out and need help.Thanks |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-08-23 : 12:26:20
|
http://www.sommarskog.se/dynamic_sql.html E 12°55'05.25"N 56°04'39.16" |
 |
|
|
legacyvbc
Starting Member
37 Posts |
Posted - 2007-08-23 : 12:55:33
|
| brilliant! Thank you so much for the help. I feel like I searched everywhere with no luck. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-08-23 : 12:56:16
|
And then you come to SQLTeam! E 12°55'05.25"N 56°04'39.16" |
 |
|
|
|
|
|