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 |
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2007-12-06 : 17:44:58
|
Can we pass the parameters in Stored procedure as table Field name and other their its value as another parameters.I have tried below query but it not giving the results.Please help in rewriting the queryDeclare @Field char(7) Declare @Value varchar(7)SET @LOCAL='TCT_CD1'SET @Value='00001'select Descr ='Total Count', Count(A.PNG) Count from TableA a WHERE (@LOCAL=''OR @LOCAL = @Value) |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-12-06 : 17:55:29
|
| It would require dynamic SQL and is not recommended. Why do you require this type of query?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
sqlfresher2k7
Aged Yak Warrior
623 Posts |
Posted - 2007-12-06 : 19:54:26
|
| Since the front applications developers has requirementthey have designed a Combo box which eventually select a fieldname from the list and enter the respective values in the textbox.It should fetch the result.They want me to write a stored procedure.Instead of creating all the combobox lists as input parameter i thought there can be better way. |
 |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
|
|
|
|
|