Get Result from diffrent dateabase

Posted by Vipinpaliwal under Sql Server on 12/7/2009 | Views : 1017 | Status : [Member] | Replies : 2
Hi all,

My problem is, I have 200 database name like 'DbI00'. All database have same structure.I need max date from single table name TAbl1 in all database and show a report.

How can i do that. Please Help me

Thanks,




Responses

Posted by: Vuyiswamb on: 12/7/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
unfortunately you have to write 200 lines of SQL statement. are you have a problem getting the max date or you thought there was a Simple Query that will loop through the database and get you the max?

thank you for posting at dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Vipinpaliwal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Abhi2434 on: 12/7/2009 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
I think you need to use SMO to loop through databases.

You might also use common sql block but provided all the database is within the same DataBase Instance.

:)

www.abhisheksur.com

Vipinpaliwal, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response