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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Multiple queries

Author  Topic 

paull
Yak Posting Veteran

50 Posts

Posted - 2009-03-11 : 12:00:38
Hi guys. I am very new to SQL having installed 2005 Express only yesterday!
I am getting on alright with my queries and actually getting the results I expected!
My question is, is there a way to "batch" a series of queries? For example, I produce a report which is 10 pages. I have written the query code to produce each table one by one, but I have to copy and paste into the excel document, run query 2, copy paste etc etc.

I really dont even know where to start!!!

Thanks in advance for your help

Skorch
Constraint Violating Yak Guru

300 Posts

Posted - 2009-03-11 : 12:35:32
You can try separating the queries with GO

Some days you're the dog, and some days you're the fire hydrant.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-11 : 13:15:26
or just organise all queries into procedure and execute it. Inside procedure populate the temporary table with result of each query and finally select from temporary table to get all results together.
Go to Top of Page
   

- Advertisement -