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 7844709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:58:28+00:00 2026-06-02T16:58:28+00:00

I have an account creation process and basically when the user signs up, I

  • 0

I have an account creation process and basically when the user signs up, I have to make entries in mutliple tables namely User, Profile, Addresses. There will be 1 entry in User table, 1 entry in Profile and 2-3 entries in Address table. So, at most there will be 5 entries. My question is should I pass a XML of this to my stored procedure and parse it in there or should I create a transaction object in my C# code, keep the connection open and insert addresses one by one in loop?

How do you approach this scenario? Can making multiple calls degrade the performance even though the connection is open?

  • 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-06-02T16:58:29+00:00Added an answer on June 2, 2026 at 4:58 pm

    If you want to insert records in multiple table then using XML parameter is a complex method. Creating Xml in .net and extracting records from xml for three diffrent tables is complex in sql server.

    Executing queries within a transaction is easy approach but some performance will degrade there to switch between .net code and sql server.

    Best approach is to use table parameter in storedprocedure. Create three data table in .net code and pass them in stored procedure.

    –Create Type TargetUDT1,TargetUDT2 and TargetUDT3 for each type of table with all fields which needs to insert

    CREATE TYPE [TargetUDT1] AS TABLE
                 (
                 [FirstName] [varchar](100)NOT NULL,
                 [LastName] [varchar](100)NOT NULL,
                 [Email] [varchar](200) NOT NULL
                 )
    

    –Now write down the sp in following manner.

     CREATE PROCEDURE AddToTarget(
         @TargetUDT1 TargetUDT1 READONLY,
         @TargetUDT2 TargetUDT2 READONLY,
         @TargetUDT3 TargetUDT3 READONLY)
         AS
     BEGIN
           INSERT INTO [Target1]
           SELECT * FROM @TargetUDT1
    
           INSERT INTO [Target2]
           SELECT * FROM @TargetUDT2
    
           INSERT INTO [Target3]
           SELECT * FROM @TargetUDT3
     END
    

    In .Net, Create three data table and fill the value, and call the sp normally.

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

Sidebar

Related Questions

I have a problem with testing an account creation process. Here is the error
I have an Account model with the following : has_one :primary_user, :class_name => User,
when calling a SSIS package (C# app) using LoadFromSqlServer, does the user account have
I have this account creation email that is sent out to anyone who is
I have an app that uses Devise to do account creation, etc. But I
I have a model User where I make heavy use of dynamic attributes. When
i have an account number that is stored in as a query string. How
I have a account page configured like the following; if(!isset($_SESSION[myusername])){ then show some login
Let's say I have an Account entity, and an AccountData entity (which stores some
Here is the cenario: I have an account created on Active Directory named Test

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.