Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Test cases for SP - how to create?
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01326936
Message ID:
01326961
Views:
19
This message has been marked as a message which has helped to the initial question of the thread.
>>>Hi everybody,
>>>
>>>I've created a quite complex (parameter-wise) SP. I now want to be able to test it.
>>>
>>>In Query designer I created a long query that I can take my parametes from. But I'm not sure how can I create parameters out from this long and complex select.
>>>
>>>Any ideas for me how to create a test case?
>>>
>>>Thanks a lot in advance.
>>
>>Right click on SP in SSMS Object Explorer. Then select Execute. It will ask you about parameters and will create a script and will run SP with parameters you passed.
>
>Thanks, but how can I set up parameters? I tried something like (started to type manually)
>
>-- test
>SELECT @PersonID = People.PersonID, People.CreatedOn, People.LastUpdated, People.DefaultPicture,
> @Pwd =People.Pwd, @UserName = People.UserName, @SiteID =People.SiteID, @Comment =People.Comment, etc.
>
>But I'm getting
>
>Msg 141, Level 15, State 1, Line 81
>A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations.
>
>And I don't see a direct way to jump to Help for this error message. How can I put the result of select statement to become my parameters? That's my question. I'd like to retrieve record for some specific IDs and pass them to my SP.
>
>Thanks again.

O!
You can't use:
SELECT @PersonID = People.PersonID,
---- Here you should assign some variables or omit these fields from SELECT
                   People.CreatedOn,
                   People.LastUpdated,
                   People.DefaultPicture,
------
       @Pwd      = People.Pwd,
       @UserName = People.UserName,
       @SiteID   = People.SiteID,
       @Comment  = People.Comment, 
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform