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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:38:48+00:00 2026-06-02T10:38:48+00:00

I save a big set of data where each record has a time-mark. I

  • 0

I save a big set of data where each record has a time-mark. I wanna save each item also with UTC time-mark so I convert the original time with use of ToUniversalTime() (VB.NET). The use of this method appears to be quite slow. Do you have any tips how to accelerate the process?

For Each i In CollectionOutput.Select(Function(f) f)
    Dim utcTimeMark = i.GetTIMEMARK.ToUniversalTime()
    contextEmanagement.pr_Collection_Store(i.GetID, i.GetTIMEMARK, utcTimeMark, i.GetVALUE)
Next

Where .pr_Collection_Store calls SQL Server stored procedure.

  • 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-02T10:38:49+00:00Added an answer on June 2, 2026 at 10:38 am

    Currently your stored procedure presumably does something like this (I am absolutely guessing at data types here, and I’m assuming you are using SQL Server 2008 or better – please specify your version when asking questions!):

    CREATE PROCEDURE dbo.pr_Collection_Store
      @GetID INT,
      @GetTimeMark DATETIME, 
      @UTCTimeMark DATETIME,
      @GetValue INT
    AS
    BEGIN
      SET NOCOUNT ON;
    
      INSERT dbo.SomeTable(ID, TimeMark, UTCTimeMark, Value)
        SELECT @GetID, @GetTimeMark, @UTCTimeMark, @GetValue;
    END
    GO
    

    You could do this instead:

    CREATE TYPE dbo.Collection AS TABLE
    (
      GetID       INT,
      GetTimeMark DATETIME,
      UTCTimeMark DATETIME,
      GetValue    INT
    );
    GO
    
    CREATE PROCEDURE dbo.pr_Collection_Store2
      @Collection AS dbo.Collection READONLY
    AS
    BEGIN
      SET NOCOUNT ON;
    
      INSERT dbo.SomeTable(ID, TimeMark, UTCTimeMark, Value)
        SELECT GetID, GetTimeMark, UTCTimeMark, GetValue
        FROM @Collection AS c
        WHERE NOT EXISTS (SELECT 1 FROM dbo.SomeTable WHERE ID = c.GetID);
    END
    GO
    

    Then from the app. Sorry, I know C#, hopefully you can translate this to VB.NET.

    DataTable tvp = new DataTable();
    tvp.Columns.Add(new DataColumn("i"));
    foreach(var i in CollectionOutput)
    { 
        tvp.Rows.Add(i.GetID, i.GetTIMEMARK, i.GetTIMEMARK.ToUniversalTime(), i.GetValue); 
    }
    
    using (connection)
    {
        SqlCommand cmd = new SqlCommand("dbo.pr_Collection_Store2", connection);
        cmd.CommandType = CommandType.StoredProcedure;
        SqlParameter tvparam = cmd.Parameters.AddWithValue("@Collection", tvp);
        tvparam.SqlDbType = SqlDbType.Structured;
        connection.Open();
        cmd.ExecuteNonQuery();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to save a record which has a many-to-one property mapping. I
I need to store some data in a file. FOR THE MOMENT each record
I need to save a big file, sometime it takes a very long time
I am experiencing big time and computing power challenges when doing big data migration
som = SOM_CLASS() # includes many big difficult data structures som.hard_work() som.save_to_disk(filename) #then later
I'm parsing big document with STAX. How do i remember, or clone, or save
i save in mysql database the time using NOW() function. how can i change
I have no idea how the big websites save the pictures on their servers.
I want to send a huge set of data to a WCF service. The
I'm trying to save a simple (but quite big) Tree structure into a binary

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.