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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Running a sequence of queries.

Author  Topic 

atiqraza
Starting Member

11 Posts

Posted - 2007-01-25 : 13:49:22
I have a table that i am loading in to my database,


I have a sequence of queries that i am running on a certain table, for example first i am sorting it, updating certain values and then joining it with another table.

Can i store all of these queries in a stored procedure or is there a way i can run all these queries at once.

Once my table is loaded i want to run all of these queries sequentially, one after the other. However i do not want to do it manually. I want to design something that runs all the queries automatically.
....Is this possible??...

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2007-01-25 : 13:52:07
Either put them in s stored procedure and execute it or a batch (a sql file) and execute it from the command line with sqlcmd. Or if you want them to run automatically create and schedule a job with all of the statements in it (or you could create the stored procedure first and run the stored procedure from the job).
Go to Top of Page
   

- Advertisement -