Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question on passing through multiple queries to SQL Server
Message
De
04/09/2002 23:10:30
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Titre:
Question on passing through multiple queries to SQL Server
Divers
Thread ID:
00696951
Message ID:
00696951
Vues:
70
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform