Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
amitmnagarwal
Starting Member
15 Posts |
Posted - 2010-05-26 : 07:47:56
|
| We have SP which takes around 2 min when executed from SQL analyzerSame SP when called from via .NET code, goes into abnormal long time.It takes approx .5 hr to 1 hr for the Fill method to fill data into dataset.we wud like to know where the problem is why the Fill method of .NET takes such a long time to fetch data from the SQL Server. |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-05-26 : 07:50:05
|
| How many records does the SP return?PBUH |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-05-26 : 08:25:58
|
| When run from .NET is it using tables of same name but in different schema? (or at least looking for such tables?)When you run it from SQL analyzer you are using the exact same database as .NET? (i.e. not a difference between Test / Production databases?)Try logging onto SQL analyzer with the exact same login that .NET uses and try it again.Is SQL analyzer on the server and .NET "remote"? Might be a network issue pulling all the data to the "client"maybe .NET is doing something with the data after getting it (so you are not seeing the actual time of the SQL call, but the total time that the .NET application takes?) |
 |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-05-26 : 09:05:56
|
| My wild guess would be that his middle tier or the data access layer is slowing it down.PBUH |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-05-26 : 09:11:35
|
Maybe the indexed column is varchar and the parameter send from your application is nvarchar?That causes an index scan instead of index seek.Just a guess...edit: typo No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
amitmnagarwal
Starting Member
15 Posts |
Posted - 2010-05-27 : 02:26:11
|
| The SP returns 3000 records.Sql analyzer is not on the server. it is on my dev machine only.There are just two sql parameters passed from front end1) Integer2) Datetime. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-05-27 : 04:40:24
|
| Are you logging onto SQL Analyzer with the same UserID/Login as the .NET application? |
 |
|
|
|
|
|