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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Stored Procedure like

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-10-09 : 09:25:07
Jeff writes "I am trying to execute a simple SQL query in a stored procedure using the the "like" function

here is my query


Alter Procedure sp_Assigned_Projects_by_Userid
@userid int
As
Select * from Department_Table, Project_Table where Project_Table.DepartmentID = Department_Table.DepartmentID
and Project_Table.visible <> '-1' and
project_Table.assigned_user like '%@userid%' order by projectid

return


obviously I am passing in a value for userid. It is having problems with the like and the %....won't allow me to execute without single ticks.... DO I need to do anythign special when I use like and %

using ASP, IIS 5, ADO and SQL 7

thanks in advance,
Jeff"
   

- Advertisement -