SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Help query
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

babreu
Starting Member

Portugal
1 Posts

Posted - 11/07/2013 :  17:07:22  Show Profile  Reply with Quote
Hello,

I make this query with de resultset the name of databases in my instance:

select p.name+'.dbo.e1' from ec join (select name
FROM sys.databases
WHERE name NOT IN ('Master','tempdb','model','msdb')) p
on ec.nomebd collate DATABASE_DEFAULT = p.name collate DATABASE_DEFAULT


know i need use the resultset to see the contain the tables

select * from (select p.name+'.dbo.e1' from ec join (select name
FROM sys.databases
WHERE name NOT IN ('Master','tempdb','model','msdb')) p
on ec.nomebd collate DATABASE_DEFAULT = p.name collate DATABASE_DEFAULT)

but it dont work. Help please

ScottPletcher
Constraint Violating Yak Guru

USA
410 Posts

Posted - 11/07/2013 :  20:41:40  Show Profile  Reply with Quote
select * from
(select p.name+'.dbo.e1' AS name
from ec
inner join (select name
FROM sys.databases
WHERE name NOT IN ('Master','tempdb','model','msdb')) p
on ec.nomebd collate DATABASE_DEFAULT = p.name collate DATABASE_DEFAULT) as derived
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000