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
 General SQL Server Forums
 New to SQL Server Administration
 database switch
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pnpsql
Posting Yak Master

India
246 Posts

Posted - 02/01/2013 :  06:29:01  Show Profile  Reply with Quote
hi team,

i have used 5 database in my application.

now there are two sets of databases say first is of dec month and second is of nov month

i have only one system and i want switch over both databses sets without dettaching other, because the switchich is freuent

challenge everything

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 02/01/2013 :  06:37:45  Show Profile  Reply with Quote
your explanation doesnt make any sense. switch database where? what determines which db to be used? do you've a parameter?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

pnpsql
Posting Yak Master

India
246 Posts

Posted - 02/01/2013 :  08:26:42  Show Profile  Reply with Quote
sorry for incomplte details,

i mean to say that

i have two folders on my system dec_database_bkp and jan_database_bkp


each folders contains 5-5 databases with same name only transaction data are diffrent.

i want to connect ssms first with dec_database_bkp and in between i want to conect ssms with jan_database_bkp
without deattaching databases. i am nalysing and fixing some data issue sor i want this.

challenge everything
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3555 Posts

Posted - 02/01/2013 :  09:01:47  Show Profile  Reply with Quote
You can attach both databases to the same server (with different names) and then query against both databases using the 3-part naming convention. For example, you would write queries such as:
SELECT
	customerid,
	lastname
FROM
	dec_database_bkp.dbo.Customers
UNION 
SELECT
	customerid,
	lastname
FROM
	jan_database_bkp.dbo.Customers
You can do similar things for joining tables, views etc. as well.
Go to Top of Page

pnpsql
Posting Yak Master

India
246 Posts

Posted - 02/01/2013 :  10:24:43  Show Profile  Reply with Quote
hi vishak, any better clue.

challenge everything
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