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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving the database to another hard disk 2

Status
Not open for further replies.

JUANCARLOS

Programmer
Oct 30, 2000
61
PE
This is a basic question, I located a database in a hard disk that have less than 100 MB free space, and I have another disk with 2 gb (the database is 246 MB) the question is how to move this database to the another disk.

Thanks in advance.

JCHR
 

Use sp_detach_db to detach the database from SQL Server. Move the files - MDF and LDF. Then use sp_attach_db to attach the database, providing the new location of the files. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
i am newbie in SQL, can be explain with more details.

thanks.

JCHR
 

Open Query Analyzer (QA). Type and then execute a script like the following.

exec sp_detach_db 'database_name'

Open Windows Explorer. Move the files to the new drive.

Back in QA, type and execute a script like the following.

exec sp_attach_db
'database_name',
'F:\mssql\data\database_name_data.mdf',
'F:\mssql\data\database_name_data.ldf'


Use your own database and file names as well as file location. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
TlBroadbent:

I dont found the sored procedures detach and attach,I have the spanish version of SQL 7.0, any ideas, how to list all stored procedures, how is the equal name of detach or attach procedures in the spanis version?

Please help me.

The free space on disk is critical.

JCHR



 
Hi JuanCarlos. The stored Procedures in my installation are under 'Databases'=>'master'=>'Stored Procedures'. I don't know what the Spanish names for the stored Procedures are, are, but Spanish Dictionary equivalents at
include
attach
1. adjuntar, anexar, anexionar
and Portuguese
attach
1. acrescentar, aplicar, apor
2. aprazar, cravar, determinar, fixar


and Spanish
detach
1. descolgar, desenganchar, separar

Good luck!
 
How can I list all stored procedures, and identify the equal detach and attach procedure.

Thanks in advance

JCHR
 
Juan Carlos,

La documentación indica que los nombres de los procedimientos son los mismos en Inglés y Español.

Puede buscar los nombres del procedimientos con esta consulta:

Select * from master.dbo.sysobjects
where type='p'

Aquí hay una referencia a estos procedimientos in Español.

Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top