Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can Stored Procedure take a Table as a Parameter
Message
 
To
03/07/2012 20:43:34
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01547558
Message ID:
01547630
Views:
29
Hi Charles.
Thanks for that.... I'll have a look also at the Strataframe Forum Post
(I have not seen too many posts from you recently in the SF forum...are you still using SF or moved on to something else ?
Regards,
Gerard


>>Hi.
>>I want to pass a Table of Primary keys to a stored procedure, with the intention of selecting out ALL children related to All the Rows passed into the SP.
>>Something Like following in Stored Procedure:
>>
>>
>>Select * from @ParentTable join ChildTable on ParetPK = ChildFK
>>
>>
>>Just wondering is it possible to pass the ParentTable as a parameter to the Stored Procedure. Code examples would be appreciated
>>The ParentTable is the Parameter I want to Pass in
>>ChildTable is a SqlServer Table in a database
>>
>>Tia
>>Gerard
>
>My guess is you don't want to pass in the whole parent table but rather a list of primary keys in order to get all the children for a set of parents. If this is the case and you are calling it from .NET remember you can pass a List of T or anything that implements iEnumerable to an SP that accepts a table valued parameter.
>
> It is useful to create a table valued data type in your sql table and a stored procedure that accepts parameter of that type which then does basically what you are showing in code above.
>
>Do I remember correctly that you used Strataframe at one time? If so, you might find a writeup I did on the SF forum useful. I used this technique a lot with SF.
>
>This spells it out in a lot of detail ( the techniques described are not at all limited to SF )
>
>http://forum.strataframe.net/Topic24706.aspx
>
>Kevin Goff had a great Baker's Dozen article in the July 2008 issue of Code Magazine that got me started on this. For some reason it is impossible to fine on the CM website but if you google around for Kevin's blog and then search you''ll find it there.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform