Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 296221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:31:43+00:00 2026-05-12T06:31:43+00:00

I have an Article object with the following properties: Article Name (varchar) Article Body

  • 0

I have an Article object with the following properties:

  • Article Name (varchar)
  • Article Body (varchar)
  • Article Tags (varchar)

The Article Tags is a space delimited string of text values that a user has tagged the aritlce with. The 3 properties are passed to a stored procedure.

I now want to do the following:

1) Insert the Article Name and Article Body in the dbo.Articles table and return the article id

2) Insert each value of the Article Tags string in the dbo.Tags table as a separate row but first check for duplicates. If duplicate then return the tagid of existing record, if new record then return the new tagid

3) insert the article id and each tagid as a separate row in the dbo.TagMap table

I need to know the best approach to how I would accomplish this, also being conscious that it does not cost too much in performance.

Thanks in advance for any help you can provide.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T06:31:44+00:00Added an answer on May 12, 2026 at 6:31 am

    I would do most of the work in your application rather than within sql. You could use one of the many sql split routines found online in conjunction with CROSS APPLY to add multiple rows to your tables, but I wouldn’t do it. Keep it simple and have your application manage the tag inserts.

    Let’s say you have an article with 5 tags. That’s one database call to create the article and return the article id back to your application (step #1 in your question.) And then, for each tag, you provide the article id and tag value in a separate database call which handles step #2 and step #3. You’re looking at 6 really quick, not-at-all complicated operations for an article which most likely has a greater than average number of tags. That’s really not all that bad.

    But that’s just my two cents. I hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have model Article it has field title with some text that may contain
I have the following Django 1.2 models: class Category(models.Model): name = models.CharField(max_length=255) class Article(models.Model):
Suppose I have an entity object defined as public partial class Article { public
Say that I have an article with multiple pages. Each page has a short
I have an table Article that is in relationship with Steps (OneToMany) and Steps
We have the following interface: [object, uuid(uuidhere), dual ] interface IInterface : IDispatch {
I following this article for sending SMS it is a winform application.. I have
I have seen the following links before posting this question http://www.devx.com/wireless/Article/40792/1954 Saving Android Activity
I have created a WCF WebHttp Service using the following article as a guideline..
I have the following block: $('.new_comment').live('ajax:success', function(evt, data, status, xhr){ $('.comments article:last').after(xhr.responseText).effect(highlight, {}, 3000);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.