Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Return Recordset for Child Tables with a TVP

$
0
0

So, here is my problem and I am having a mind blank...

I have created a Parent table (User_Accounts) and I have two child tables (User_Skills and User_Locations)

The tables are as follows:

User_Accounts

IDFirstNameLastName
1      BobSmith
2John Doe

User_Skills

IDSkillID User_Account_ID (FK to Accounts table)
111
221
341
432

User_Locations

IDLocID User_Account_ID (FK to Accounts table)
111
221
341
432

What I want is to return a record set that has searches against the child tables. However there is no limit to the amount of search criteria for the skill and locations as long as it matches any of those it should return the users First/Last name and ID.

In C# I've tried to use TVP (which is selected using a checkboxlist) to send through the array of SkillID's and LocIDs but I am not sure what I do with it now?

I am using SQL 2012.

Thanks in advance.



Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>