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 2008 Forums
 Other SQL Server 2008 Topics
 Problem with sysfiles

Author  Topic 

Tobias Burz
Starting Member

4 Posts

Posted - 2008-10-27 : 06:24:31
Hello,

I have created a new database and copied the older database to the new database.
Now I detect that in the sysfiles table there is the same name as in the old database. I tried to rename the name in the column "name" but it fails because the sysfiles table cannot be modified.
Is there no other possibility to rename the content of the name in the sysfile table?

Regards
Tobias

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-27 : 06:26:50
use sp_rename system stored procedure
http://doc.ddart.net/mssql/sql70/sp_ra-rz_11.htm
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-27 : 06:27:17
copied?
What does that mean?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

Tobias Burz
Starting Member

4 Posts

Posted - 2008-10-27 : 12:00:11
Hello Peso,
I have the two database files with Test_UHD_Data.MDF and Test_UHD_Data.LDF.

I have created the new database with the name FU_UHD. With creating this database the standard database files was created automatically: FU_UHD_Data.MDF and FU_UHD_Data.LDF.

Now I have deleted the standard files Test_UHD_Data.MDF and Test_UHD_Data.LDF.
Then I have copied the Test_UHD_Data.MDF and Test_UHD_Data.LDF files and set these with the new names FU_UHD_Data.MDF and FU_UHD_Data.LDF.

In the SQL Server Enterprise Manager I detect that in the row "name" of the table sysfiles in the FU_UHD_Data database there is the same name as in the Test_UHD_Data database.
And I want to rename this but it fails.

I hope this explain it better for you.

@visakh16:
This procedure is to be done directly in the SQL Server Enterprise Manager or in the cmd window?

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-27 : 12:08:54
Visakh, he wants to UPDATE the sysfiles.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-27 : 12:09:09
Never mess with the system tables! Use ALTER DATABASE instead for this.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-27 : 12:42:52
quote:
Originally posted by Peso

Visakh, he wants to UPDATE the sysfiles.



E 12°55'05.63"
N 56°04'39.26"



Ah...forget that
Go to Top of Page

Tobias Burz
Starting Member

4 Posts

Posted - 2008-10-29 : 09:47:28
Hello Tara,

sorry, I am not an expert in modifying the database table.
Can you please send me the code for modifying the content of the sysfile table?
The name of my database is: FU_DB

The sysfile table looks like:
fileid groupid size maxsize growth status  perf name              filename
1 1 1368 -1 10 1081346 0 TestJensUHD_Data C:\Programme\...\FU_UHD_Data.MDF
2 0 1400 -1 10 1081410 0 TestJensUHD_Log C:\Programme\...\FU_UHD_Data.LDF


This table should be changed to:
fileid groupid size maxsize growth status  perf name         filename
1 1 1368 -1 10 1081346 0 FU_UHD_Data C:\Programme\...\FU_UHD_Data.MDF
2 0 1400 -1 10 1081410 0 FU_UHD_Log C:\Programme\...\FU_UHD_Data.LDF


You see that the two contents of the column "name" should be changed only.
It would be great if you can give me the code.

Best regards
Tobias
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-10-30 : 18:41:54
Do not modify the sysfile table to change this data. That is not how you change system data. Look up ALTER TABLE in SQL Server Books Online. You'll use the MODIFY FILE option.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Tobias Burz
Starting Member

4 Posts

Posted - 2008-11-04 : 02:38:16
Hello Tara,

many thanks! Now I could "prepare" the content of the DB table.

Regards
Tobias
Go to Top of Page
   

- Advertisement -