Solved

C# and SQL Server with User Defined table

Posted on 2016-07-21
4
104 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how the fundamental information of how to create a table.

717 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