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 2012 Forums
 Transact-SQL (2012)
 Changes the database which specified spid context

Author  Topic 

sudo8
Starting Member

2 Posts

Posted - 2013-06-05 : 00:33:13
hi,
I want changes the database which specified spid context to the specified database

A spid:53, current database :test
B spid:54, current database :master

now, i'm B, I want change A current database to master also, what should I do?

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-06-05 : 00:53:36
You can do like this:
-- Method1:
I think you are talking about shift to next tab in SSMS
You can use Ctrl+TAB keys from keyboard

If the above is not the case, I guess this one
-- Method2:
USE databaseName (i.e. test )
GO



--
Chandu
Go to Top of Page

sudo8
Starting Member

2 Posts

Posted - 2013-06-05 : 01:19:06
quote:
Originally posted by bandi

You can do like this:
-- Method1:
I think you are talking about shift to next tab in SSMS
You can use Ctrl+TAB keys from keyboard

If the above is not the case, I guess this one
-- Method2:
USE databaseName (i.e. test )
GO



--
Chandu



Thank you for your replay first!
'USE databaseName' is changes current session,can't changes specified session.i want to know how to changes database which specified session on current session
Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-06-05 : 01:44:16
It may help you
http://msdn.microsoft.com/en-us/library/ms188268(v=sql.105).aspx

--
Chandu
Go to Top of Page
   

- Advertisement -