Solved

C# and SQL Server with User Defined table

Posted on 2016-07-21
4
82 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
  • 2
4 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now