Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question on passing through multiple queries to SQL Server
Message
From
04/09/2002 23:10:30
 
 
To
All
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
Question on passing through multiple queries to SQL Server
Miscellaneous
Thread ID:
00696951
Message ID:
00696951
Views:
71
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
Next
Reply
Map
View

Click here to load this message in the networking platform