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 |
Sycopons
Starting Member
4 Posts |
Posted - 2012-03-21 : 02:07:35
|
I have a problem in having query like this . But there's no effect on it.@FieldName varchar(20),@Search varchar(10),asSELECT * from tbl_name Where @FieldName Like @SearchxSycopons |
|
stepson
Aged Yak Warrior
545 Posts |
Posted - 2012-03-21 : 03:32:34
|
set @str = ' SELECT * from tbl_name Where ' + @FieldName + ' Like ' + @Search +''''exec (@str)I think , this is not the right approachbe carefull about sql injection ,read about it (sql injection) |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
Sycopons
Starting Member
4 Posts |
Posted - 2012-03-24 : 19:58:27
|
Thank you both for the quick response. .xSycopons |
 |
|
|
|
|