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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | 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
 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
Aged Yak Warrior

USA
550 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  
 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.04 seconds. Powered By: Snitz Forums 2000