Tuesday 15 February 2011

sql server 2012 - How to execute stored procedure with table-valued parameter from SSMS -


When I right click a stored procedure, and execute the stored process command, select a table-value as I What value should the value for the parameter be?

I'm not talking about the SSMS "query" window. I'm talking about the "executed process" dialog box that is shown when you right-click on a sp.

Can I supply parameter value, directly in this screen through a SP?

This can be done for example, for example, you defined this table type That's two:

  type dbo.ContactsList create table (NET) (ContactID VARCHAR (25)); GO   

If you want to perform a stored procedure that takes one of these parameters from within SSMS, to do this, select Perform stored process from within SSMS, parameter Provide a junk value for the value, and click OK. This will generate both boilerplate codes to replace this replacement, execute the stored procedure and give you an error message.

After that, modify the boiler plate to do something like this @ContactIdsTableParameter (use your own variable name) for the junk price you last used: < Pre> as dbo.ContactsList INSERT INTO @ContactIdsTableParameter (ContactID @ContactIdsTableParameter Announcement) @ContactIdsTableParameter (select 1 in Insert In ContactID) Select 100,002,787 * Announcement from @ContactIdsTableParameter @return_value integer EXEC @return_value = [ Dbo]. [Usp_MGOAssignmentsGet] @ContactIdsTable = @ContactIdsTableParameter Choose 'return value' = @return_value GO above your version

Finally, execute for example & lt; F5 & gt; With .

No comments:

Post a Comment