Jump to content

Stored Procedure Prob


shyam

Recommended Posts

HELLO ALL,

i have a problem with below query
create procedure selectallreg@name varchar(50)asselect * from generalreg where name like @name'%'
I WANT TO CREATE A QUERY WHICH RETURN THE NAME START WITH GIVEN DATA;EXAMPLEIF "SA" IS GIVEN AS A VALUE TO @NAMETHEN IT WILL RETURN DATA START NAME WITH "SA"HELP PLS....

Link to comment
Share on other sites

Check examples C and D on this page:http://msdn.microsoft.com/en-us/library/aa...59(SQL.80).aspxIt looks like the way to do it is to send the percent wildcard sign with the data. So instead of sending the SP "SA" as the name, you would send "SA%". If you want to automatically add the wildcard in the SP, there is probably a string concatenation function you can use for that.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...