Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Help query

Author  Topic 

babreu
Starting Member

1 Post

Posted - 2013-11-07 : 17:07:22
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
Aged Yak Warrior

550 Posts

Posted - 2013-11-07 : 20:41:40
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
   

- Advertisement -