Author |
Topic |
cognos79
Posting Yak Master
241 Posts |
Posted - 2006-11-13 : 16:35:27
|
I do have an application with upload feature. 5000 users can use the application. when some users hit the upload the button at same time which inturn calls the stored procedure will there be any performance issues or sql server takes care of it??? locking of tables like that. |
|
X002548
Not Just a Number
15586 Posts |
|
cognos79
Posting Yak Master
241 Posts |
Posted - 2006-11-13 : 16:55:47
|
I do have application where users can upload data into sql server. Duplicates are not allowed to be inserted into final table. when user hits upload button all the data will be inserted into staging table and from there I check for duplicates using "NOT IN" condition and insert the non-duplicates into final table. My question is when 500 users hits upload button at same time. will there be performance checks I have to be aware of??? |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-11-13 : 22:11:36
|
Do you have transactions in place to take care of concurrency issues?Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
cognos79
Posting Yak Master
241 Posts |
Posted - 2006-11-14 : 09:30:37
|
Harsh...Do I have to use transactions for the INSERT statement??? |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-11-14 : 09:43:48
|
Yes, you would have to add transactions for the piece of code which insert into final table.Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
cognos79
Posting Yak Master
241 Posts |
Posted - 2006-11-14 : 10:11:17
|
when two users upload data into final table, the records they are uploading have userid associated with it. so why do I have to use transactions.can you please explain??? |
 |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2006-11-14 : 10:35:01
|
no you won't have a problem as long as the userid is unique.Go with the flow & have fun! Else fight the flow blog thingie: http://weblogs.sqlteam.com/mladenp |
 |
|
X002548
Not Just a Number
15586 Posts |
Posted - 2006-11-14 : 10:35:07
|
What do you mean by "upload"?Can you share the code? Is it bcp's, do you use temp tables, we need more info.Oh, and by default, even if you don't specify BEGIN TRAN, it is implicitly a transaction that gets committed at the end of the thread, unless something happens, then it's rolled back.In either case, error handlling is a good ideaBrett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam |
 |
|
cognos79
Posting Yak Master
241 Posts |
Posted - 2006-11-14 : 10:54:52
|
X002548...I dont have the code written yet. But it will look like this.In the front end .net application the user can browse to .csv file from his local machine and when he hits upload button, I am using sqlbulkcopy in ado.net 2.0 (here is the link to that code sample http://dotnetslackers.com/Articles/ADO_NET/SqlBulkCopy_in_ADO_NET_2_0.aspx) and putting the data in temp table. after that I invoke the stored procedure through .net code which checks for duplicates and inserts the data into final table. here is the sql i am going to use..(mydata is final table and orders is temp table).insert mydata( [name] ,address ,city)select o.[shipname],o.shipaddress,o.shipcity from orders owhere shipname not in( select [name] from mydata d where d.[name] = o.[shipname] and d.address = o.shipaddress and d.city = o.shipcity )everybody is giving there own comments. can you guys summarize plz what i should follow. |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-11-14 : 13:07:58
|
quote: Originally posted by X002548 Is a car a bad one because you can drive it off a bridge?
Yes, if it is powered with Window CE.The built-in warning system should have rebooted the steering system before crashing... Peter LarssonHelsingborg, Sweden |
 |
|
|