Profile

Showing posts with label find. Show all posts
Showing posts with label find. Show all posts

Thursday, 23 May 2013

Find Server Name, Database name from Tables

When querying data from multiple database across multiple server, a simple two lines of SQL code can tell where the data comes from 

SELECT
@@servername,
DB_NAME() as 'Database name'

FROM dbo.tablename