Jump to content

Stored Procedure Prob


shyam
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...