Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move tempdb..?

Status
Not open for further replies.

kenjoswe

Technical User
Sep 19, 2000
327
SE
Hi all,

I would like to move tempdb from C:\ to D:\.
How can I do this?
Can I just detach database, move it to the new location, and then attach the database?

/Kent J.
 
use master
go
Alter database tempdb modify file (name = tempdev, filename = 'D:\Sqldata\tempdb.mdf')
go
Alter database tempdb modify file (name = templog, filename = 'D:\Sqldata\templog.ldf')
Go



Thanks

J. Kusch
 
Then stop and restart the SQL Server services. Every time the services are stopped and restarted, SQL Server 'rebuilds' the TEMPDB. That's when it will go to the new location.

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top