all groups > sql server programming > july 2007 >
You're in the

sql server programming

group:

procedure that returns a dataset? how can I test it?


procedure that returns a dataset? how can I test it? jobs
7/14/2007 1:44:17 PM
sql server programming:
Really Dumb question.

I have this simple procedure that will return a dataset to my asp.net/
vb.net application. I've done this before.

How can i test it from sql server 2005? I know rows qualify, but the
default execute procedure only returns 0.

And apparently, I can't do this: select * from p1_sp


and this only produces "command completed successful"

exec p1_sp 'Title Search','xxx',''

Is there a way to select from a stored procedure?
...

ALTER procedure [dbo].[p1_sp]

@searchType varchar(10),
@s1 varchar(30),
@s2 varchar(30)


AS

If @searchType = 'Title Search'
BEGIN
select f1 from t1 where title like '%xxx%' -- hard code to see
why not working
END

--

Thanks for any help or information!
Re: procedure that returns a dataset? how can I test it? Dan Guzman
7/14/2007 4:09:56 PM
[quoted text, click to view]

You are passing 12 character string ('Title Search') but only 10 characters
are allocated for the parameter. Try specifying (at least) varchar(12).

--
Hope this helps.

Dan Guzman
SQL Server MVP

[quoted text, click to view]
Re: procedure that returns a dataset? how can I test it? jobs
7/14/2007 8:17:50 PM
Thank you.
AddThis Social Bookmark Button