Solved

combining Microsoft SQL queries

Posted on 2013-12-28
6
281 Views
Last Modified: 2013-12-28
I need to combine about 12 queries into 1, so I can update about 100 databases faster.  The queries are attached.

THanks
Run-in-query-analyzer-4-4-5.zip
0
Comment
Question by:indyit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 11

Expert Comment

by:Gregory Miller
ID: 39743791
Can you explain what you mean by combine them? SQL Queries should be able to be appended to each other and run all at one time. They will run asynchronously one after the other. The next one will not run until the previous one finishes. Is this what you mean?
0
 
LVL 13

Expert Comment

by:AielloJ
ID: 39743795
indyit,

With the number of different tables involved, getting it into 1 query isn't going to happen.  Can you tell me more about what you're trying to accomplish?  Why are there 100 databases all requiring the same information?  Are these databases on a common network?

AielloJ
0
 

Author Comment

by:indyit
ID: 39743812
essentially I just need to be able to 'manually' run this query on each database that is updating a software package with a 'new' version.  it doesn't mater if they run sequentially or not...as long as I physically don't have to keep selecting the next query to get the database updated.  onnce it starts to run I can move on to the next database.  this is how I normally do it, but my SQL guy is not available
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:indyit
ID: 39743822
Is this something someone can physically do?  combine the queries and email me the query?
0
 
LVL 11

Accepted Solution

by:
Gregory Miller earned 500 total points
ID: 39743874
They are only text files...

unzip them all into a single folder called c:\batch\
run the command Copy c:\batch\*.sql c:\batch\OneBigQuery.sql

This will combine all files into one for you and you are all set.

MAKE GOOD BACKUPS OF YOUR DATABASES BEFORE YOU DO THIS...
0
 

Author Closing Comment

by:indyit
ID: 39743931
wow simple and elegant....simple for you , but a real solution for me...

Thanks!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question