Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Joining table to Master SQL Command

$
0
0

Hi,

I have setup  a Local Server Group with the intention of running the below SQL command to pull out the servers and databases in the Local Server Group:

USE Master

SELECT  CAST(@@SERVERNAME AS VARCHAR) AS ServerName,
  name AS DBName,
  database_id,
  recovery_model_desc,
  owner_sid
FROM sys.databases

However I have also built a database that manually holds that information on the server: SQL2K8DEV01, Database: GroupBSServers, Table: Server.  I want to join the GroupBSServer Databases to the above command so I can pull through a Unique Number.

Can this be done?

Regards,

Jon Ditchfield


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>