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 |
|
jemacc
Starting Member
42 Posts |
Posted - 2004-10-03 : 02:18:59
|
| I will like to add to the statement below the following criteriaselect @sql =SELECT @SQL = @SQL + ' WHERE (EmployeeID) = @EmployeeID',how can I do this?USE NorthwindGODECLARE @SQL varchar(8000), @EmployeeID,@tblname sysnameSELECT @tbname = 'Employees'SELECT @SQL = 'SELECT * FROM ' + @tblnameSELECT @SQL = @SQL + ' WHERE (EmployeeID) = 5'EXEC(@SQL)GO |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-10-03 : 11:02:34
|
do this:SELECT @SQL = 'SELECT * FROM ' + @tblnameSELECT @SQL = @SQL + ' WHERE EmployeeID = ' + @EmployeeIDGo with the flow & have fun! Else fight the flow |
 |
|
|
jemacc
Starting Member
42 Posts |
Posted - 2004-10-03 : 12:27:14
|
| Thank you so much for time,help and knowledge"Our lives begin to end the day we become silent about things that matter."- Dr. Martin Luther King, Jr. "The mind does not take its complexion from the skin..."- Frederick Douglass There is always a way to do it better . . . find it!" Thomas A. Edison |
 |
|
|
|
|
|