Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question on passing through multiple queries to SQL Serv
Message
De
05/09/2002 00:21:08
 
 
À
04/09/2002 23:10:30
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00696951
Message ID:
00696959
Vues:
10
Kevin,

Why aren't you allowed to use SPs? Seems silly to me ....

Some good questions, and I don't know the answers off the top of my head, but I know what you can do to see about question #2. Run SqlProfiler and see how the calls to SQL are made.

One good thing about combining these multiple SELECT statements is (I'm assuming) that it returns one DataSet with multiple tables ... is that correct? If so, that's preferable (IMHO) to running two SELECTs and having to deal with two separate DataSets, although I suppose that it all depends on what you're doing with the data.

In a semi-answer to #1, I've passed a fairly large, fairly complex SELECT statement with lots of JOINs and haven't seemed to yet reach a size limit on the string. But, I don't know what that limit, if any, would be.

~~Bonnie



>I discovered a few weeks ago that I could run multiple queries in one statement, delimited by a semi-colon...in other words...
>
>MyAdapter = new SqlDataAdapter("select * from table1; select * from table2", MyConnection);
>
>I've also discovered that I *believe* I can use this to 'mimic' a stored proc that needs to run multiple queries and/or return multiple result sets.
>
>Two questions:
>
>1) What is the limit on the string for the 1st parameter to SQLDAtaAdapter?
>
>2) Are there less 'round trips' to SQL Server if I combine multiple SELECT statements and delimit them with a semi-colon? I'm just wondering if that's faster than separate SQLDATAADAPTER calls. If it's not faster and/or the max length of the string isn't that high, then I guess separate calls is better.
>
>I'm not allowed to use stored procs, so I'm trying to come up with decent workarounds
>
>Thanks,
>Kevin
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform