If you want to run all the scripts in a preferred order then I'll recommend you to turn on the SQLCMD mode in SSMS and use the :r command to call the scripts.
You can even save that script and call it from command prompt using the SQLCMD utility: SQLCMD -E -dDatabaseName -ic:\Scripts\MainScript.sql
Amour22015
ASKER
I should have mentioned that all I want to do is SAVE all scripts into one.
Vitor Montalvão
I think everyone understood what you want and Chauu gave you a good solution to achieve that but ScottPletcher alerted you for some issues that can happen with that solution so I gave you another option to accomplish that by running all scripts each one within their own context so you can avoid the issues that you was alerted to.
I would be grateful to have this kind of support from experts.
One of my co-workers did it so easy the last time but I forgot how to do this and don't want to ask him again. It seems that what he did was not so complicated.
Lets make sure we are talking about the same thing?
When I save One script I do:
File>Save All
but that saves only one at a time.
I want to save all the scripts I have up in the window(s) into one so co-worker can take that script and move it into live.
I tried Chauu and got error "Incorrect syntax near '*'.
This is what I am looking for but I don't remember my co-worker doing that. I will see when he goes to bring that script into live. Thanks for helping me. Wanted to let you all know that I am grateful to have support from experts and am not trying to disagree only trying to understand.
Amour22015
ASKER
Vitor,
Once again:
"Chaau's solution is to run in command prompt (DOS)." not in SQL Server Management Studio (SSMS).
I started working in computers in 1984 so I know about the DOS prompt but seems like technology has gone past me lately. What I learn today is gone tomorrow, we should have all been paid like doctors?
You can even save that script and call it from command prompt using the SQLCMD utility:
SQLCMD -E -dDatabaseName -ic:\Scripts\MainScript.sq