Insert. Is this possible

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I have three tables: Posts, Tags and PostsTags.
Each post is related with various tags through PostsTags.

Is it possible given a Post with its Tags to save all in all tables in
one command?

Or do I need to insert the Post, then the Tags and later the PostsTags
in the database?

Just wondering.

Thanks,
Miguel
 
Hello,

I have three tables: Posts, Tags and PostsTags.
Each post is related with various tags through PostsTags.

Is it possible given a Post with its Tags to save all in all tables in
one command?

Or do I need to insert the Post, then the Tags and later the PostsTags
in the database?

Just wondering.

Thanks,
Miguel

If you have defined constraints on table i mean primary key on posts
and tags with foriegn key on posts tags. I am assuming that the
posttags is many as to many with post and tags. If this constraint is
defined you need to first insert in to post and then tags and then
post tags.

If you want to insert in go ( i am assuming you are asking from SP
perspective) you can pass all data as XML and use the selectinto SQL.

Regards
Shiv
http://www.questpond.com ( View free design pattern video)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Linq. Select 1
Linq. Avoid Joins 2
XML and SQL database 3
Filter 1
LINQ. Who knows how to do this? 2
Linq > Group 2
Local Sequence cannot be used ... except the Contains() operator 4
Linq. Delete Record 2

Back
Top