Link to home
Start Free TrialLog in
Avatar of dbaSQL
dbaSQLFlag for United States of America

asked on

TVP insertion

i have a bunch of user-defined table TYPES, to which i am doing table-valued parm insertions.

suddenly the table def needs to change, and i need to put FK's on two values within the target tables, that are written to with these TVP's.

i can put FK's on the target tables, right?  they needn't go on the TYPE tables, too, do they?
what's the best way to handle that?
ASKER CERTIFIED SOLUTION
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dbaSQL

ASKER

yes, i realize they can't go onto the TYPEs, but i'm just saying that's not really a big deal, and I'd put them onto the regular tables themselves.  right?

i didn't go for a table type instead of a table, i am inserting into a regular table via the table types, simply for massive data inserts.  i use the table-valued-parameter insert thru my table types, to do the large inserts in fewer round trips from client to server

i know i can put unique constraints or pk's onto the table types, but i'm just wondering... is it sufficient merely to put the FK's into place on the target table

going to try it out now
Avatar of dbaSQL

ASKER

yep.  seems to work just fine.  though i answered my own inquiry, i will award and close.  thank you for looking