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
 General SQL Server Forums
 New to SQL Server Programming
 sys.databases table updation possible????

Author  Topic 

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2007-05-01 : 03:13:52
Dear Folks,
Is it possible to update sys.databases table?

i need to update one column in this table.........

but it is showing some error

Msg 259, Level 16, State 1, Line 2
Ad hoc updates to system catalogs are not allowed.


how can i update this table?



Vinod

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2007-05-01 : 08:59:35
you go to the database where this table exists, and update it there.

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

sshelper
Posting Yak Master

216 Posts

Posted - 2007-05-01 : 09:31:35
It is not advisable to update system tables but if you really need to, you first have to enable the updating of system tables by using the sp_configure system stored procedure. Look for the "allow updates" option and change its value.

Just to quote from Books Online:

"Caution Updating fields in system tables can prevent an instance of Microsoft® SQL Server™ from running or can cause data loss. If you create stored procedures while the allow updates option is enabled, those stored procedures always have the ability to update system tables even after you disable allow updates. On production systems, you should not enable allow updates except under the direction of Microsoft Product Support Services."

SQL Server Helper
http://www.sql-server-helper.com
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-05-01 : 09:49:53
You can't update system tables in sql2k5. By the way, sys.databases is a view.
Go to Top of Page

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2007-05-02 : 01:09:14
Thank you for the great information. actually my log file was not reusable situation.........I dont know exactly why? but some how i found that the drive is completly filled.(disk drive partition). After check this situation, I've deleted some unused files, now it is working well. the problem was solved.

thank you for the support

Vinod
Go to Top of Page
   

- Advertisement -