Solved

C# and SQL Server with User Defined table

Posted on 2016-07-21
4
98 Views
Last Modified: 2016-08-05
I have a C# Web Service that accepts inbound JSon Data
Uses newton soft to parse and a function to place into a .Net DataTable

I then pass that DataTable into SQL Server Stored procedure as a type Structured
My Stored proc accepts the TYPE
Inserts data into a table
Works clean and smooth

I have now learned that I will begin receiving the data instead of 5-10 records at a time (Dtatable is 10 columns)
But around 50K records.

So my question...
Will my service handle this ok?

Web Service and SQL Server instance are on the same server
0
Comment
Question by:lrbrister
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 41723297
can you think of upgrading to SQL 2016? Because json is supported in that newer version. Have a look at http://emoreau.com/Entries/Articles/2016/06/New-in-SQL-2016--Native-support-from-JSON.aspx
0
 
LVL 20

Expert Comment

by:Russ Suter
ID: 41723317
For that many records you might consider just reading the file into a DataTable then using SqlBulkCopy to transfer the data into a table. You could then modify your stored procedure so it simply uses the table data. SqlBulkCopy is extremely fast. It does however have the downside of being difficult to troubleshoot if your data doesn't match the table definition.

This is my preferred method for importing large chunks of external data into a database. It has the added bonus of allowing me to write whatever business logic I need in C# to ensure the best data result.
0
 

Author Comment

by:lrbrister
ID: 41723392
Hey guys,
 I just learned that the data will come to me in batches with a max size of 1MB.

That seems very manageable?

The bulk copy would be an option if I were the one controlling the inbound data... but I am not.

SQL 2016 is at least a year away.
0
 

Author Closing Comment

by:lrbrister
ID: 41744914
Thanks
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question