<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sybase数据库技术，数据库恢复专家 &#187; 系统表</title>
	<atom:link href="http://www.dbainfo.net/tag/%e7%b3%bb%e7%bb%9f%e8%a1%a8/feed" rel="self" type="application/rss+xml" />
	<link>https://www.dbainfo.net</link>
	<description>提供Sybase ASE及Sybase SQL Anywhere数据库修复服务，电话：13811580958(微信)，QQ：289965371！We have many years of experience in recovering data from damanged Sybase devices. Contact us by Phone: +86 13811580958 Wechat: 13811580958 Email: 289965371@qq.com</description>
	<lastBuildDate>Sat, 14 Jun 2025 16:28:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SQL2005 如何更新系统表</title>
		<link>https://www.dbainfo.net/sql2005-direct-update-system-catalogs.htm</link>
		<comments>https://www.dbainfo.net/sql2005-direct-update-system-catalogs.htm#comments</comments>
		<pubDate>Wed, 03 Nov 2010 05:41:15 +0000</pubDate>
		<dc:creator>dbainfo</dc:creator>
				<category><![CDATA[SQL SERVER]]></category>
		<category><![CDATA[sqlserver]]></category>
		<category><![CDATA[系统表]]></category>

		<guid isPermaLink="false">http://www.dbainfo.net/?p=390</guid>
		<description><![CDATA[Most of us know how to update system table in sql server 2000, but there is rare information about how to do it in sql 2005. We know, Microsoft doesn&#39;t like anyone that is not in Microsoft company to update sql server system tables. But he always likes to leave a back door for himself. [...]]]></description>
			<content:encoded><![CDATA[<p>Most of us know how to update system table in sql server 2000, but there is rare information about how to do it in sql 2005. We know, Microsoft doesn&#39;t like anyone that is not in Microsoft company to update sql server system tables. But he always likes to leave a back door for himself. I think, the men, who commited themselves to design and develop SQL sever 2005 in Microsoft, would be the first ones know how to update SQL 2005 system table. And I look for related infomation in msdn again and again, finally, I conclued the following way to update sql 2005 system table.</p>
<h2>Two necessary conditions for updating sql 2005 system table.</h2>
<pre class="sqlcode">1. Start sql server 2005 instance in single-user mode.
2. Connect to sql server 2005 instance via DAC(dedicated administrator connections)</pre>
<p>I will demo how to update sql 2005 system table as follows:</p>
<pre class="sqlcode">1. Enter windows services management : [start] -- [run] --[services.msc]
2. Focus on your sql server instance name. [right button] -- [property]
3. Find sqlservr.exe path in [Path to executable]</pre>
<p><img alt="sql 2005 update system table -- services" height="494" src="https://www.dbainfo.net/wp-content/uploads/image/sql 2005 update system table -- services.jpg" title="sql 2005 update system table -- services" width="444" /></p>
<p>For me the sqlservr.exe install path is &quot;D:\Microsoft SQL Server\MSSQL.1\MSSQL\Binn&quot; Let&#39;s see how to start sql 2005 instance in single-user mode.<span id="more-390"></span></p>
<pre class="sqlcode">C:\&gt; d:
D:\&gt; cd D:\Microsoft SQL Server\MSSQL.1\MSSQL\Binn
D:\Microsoft SQL Server\MSSQL.1\MSSQL\Binn&gt; sqlservr.exe -sSQL2005 -m</pre>
<p>&#39;-sSQL2005&#39; said that the sql server instance name is &#39;SQL2005&#39;. &#39;-m&#39; parameter said that we will start sql server in single-user mode. If successful, then SQL Server instance start up. If it can not start, you can restart the computer and try again. if error again, you can seek helps on net.</p>
<h2>2. Connect sql server 2005 via DAC</h2>
<p>The normal way to connect sql 2005 in DAC mode is sqlcmd -A</p>
<pre class="sqlcode">c:\&gt; sqlcmd -E -S MYPC\SQL2005 -A</pre>
<p>If you&#39;d like to use login name and password, references as follows:</p>
<pre class="sqlcode">c:\&gt; sqlcmd -U sa -P *** MYPC\SQL2005 -A</pre>
<p>If DAC IP and port of your sql 2005 are : 127.0.0.1 and 1183. References as follows:</p>
<pre class="sqlcode">c:\&gt; sqlcmd -U sa -P *** 127.0.0.1,1183</pre>
<p>Note: here we don&#39;t need a -A param in &#39;sqlcmd&#39; command. DAC connection port is different from the common sql server connection. but how to get the SQL Server DAC port个 It is easy: when start sql server in windows command line. there is a lot of log info to echo on the screen. locate the info contain string &quot;Dedicated admin connection&quot;. for me it is:</p>
<pre class="sqlcode">Server is listening on [ 127.0.0.1 [ipv4] 1183].
Dedicated admin connection support was established for listening locally on port 1183.</pre>
<p>The above information tell us that sql 2005 listing on 127.0.0.1:1183 to accept DAC client request.The results in command line are disorderly and unsystematic. Luckily, we can also use DAC connection through SQL Server Management Studio(SSMS).</p>
<p>Note that the &quot;Server name&quot; is &quot;127.0.0.1,1183&quot;. in addition there will be an error prompt:</p>
<p>Don&#39;t worry, just ignore it.</p>
<h2>3. Update sql 2005 system table example</h2>
<pre class="sqlcode">use master
go

create table ddd(id int not null)
go

insert into ddd(id) values(10)
go</pre>
<p>We create a new table called &quot;ddd&quot;. now, I show the meta data of &quot;ddd&quot; in sql 2005 system table.</p>
<pre class="sqlcode">select * from sys.sysschobjs where name = &#39;ddd&#39;</pre>
<p>I ignore two fields &quot;creatd&quot;, &quot;modified&quot;, for a nice format in web page.</p>
<pre class="sqlcode">id         name  nsid nsclass status   type pid  pclass intprop  created modified
---------- ----- ---- ------- -------- ---- ---- ------ -------- ------- --------
1211151360  ddd   1    0       917504   U    0    1      1       2008*** 2008***</pre>
<p>I rename table from &quot;ddd&quot; to &quot;sqlstudy&quot; in the following:</p>
<pre class="sqlcode">update sys.sysschobjs set name = &#39;sqlstudy&#39; where name = &#39;ddd&#39;</pre>
<pre class="sqlcode">Warning: System table ID 34 has been updated directly in database ID 1 and cache coherence
may not have been maintained. SQL Server should be restarted.</pre>
<p>Because &quot;cache coherence&quot; problem, may make us restart the sql server instance to see the changes.</p>
<pre class="sqlcode">select * from sqlstudy</pre>
<pre class="sqlcode">id
-------
10</pre>
<h2>View the system tables in sql server 2005 master db.</h2>
<pre class="sqlcode">select name from sys.all_objects where type = &#39;S&#39; order by name</pre>
<p>&nbsp;</p>
<p>转自：http://hi.baidu.com/luck001221/blog/item/9c3fdc224dcb1f49ac34de6a.html</p>
<div style="clear: both; margin: 10px 0pt; border: 1px dashed rgb(153, 153, 153); font-size: 12px; padding: 5px 10px;">
<li>本文链接地址：<a href="https://www.dbainfo.net/sql2005-direct-update-system-catalogs.htm">https://www.dbainfo.net/sql2005-direct-update-system-catalogs.htm</a>；</li>
<li>本文为dbainfo个人原创，请在尊重作者劳动成果的前提下进行转载；</li>
<li>转载务必注明原始出处 : <a href="https://www.dbainfo.net/">Sybase数据库技术，数据库恢复专家</a>；</li>
<li>对《<a href="https://www.dbainfo.net/sql2005-direct-update-system-catalogs.htm">SQL2005 如何更新系统表</a>》有何疑问或见解，请在本文下方发表；</li>
<li>对网站还有其他问题或建议，请提交在<a href="https://www.dbainfo.net/messages" target="_blank">留言板</a>，谢谢！</li>
</div>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2019-04-11 -- <a href="https://www.dbainfo.net/sql-server-recovery-service.htm" title="SQL Server 数据库修复专家SQLRescue">SQL Server 数据库修复专家SQLRescue</a> (0)</li><li>2010-09-28 -- <a href="https://www.dbainfo.net/sql-server-database-all-tables-space-order-desc2.htm" title="SQL SERVER中查看表占用空间的另外一种方法">SQL SERVER中查看表占用空间的另外一种方法</a> (0)</li><li>2010-09-16 -- <a href="https://www.dbainfo.net/java-connect-to-sqlserver-demo.htm" title="Java连接SQL Server数据库的一个简单例子">Java连接SQL Server数据库的一个简单例子</a> (0)</li><li>2010-09-15 -- <a href="https://www.dbainfo.net/sql-server-database-all-tables-space-order-desc.htm" title="统计SQL SERVER数据库内所有表占用空间并排序">统计SQL SERVER数据库内所有表占用空间并排序</a> (0)</li><li>2010-09-06 -- <a href="https://www.dbainfo.net/sql-server-linked-server-summary.htm" title="SQL Server的链接服务器技术小结[转]">SQL Server的链接服务器技术小结[转]</a> (0)</li><li>2010-08-29 -- <a href="https://www.dbainfo.net/access-sqlserver-from-oracle-by-transgate.htm" title="从oracle内访问sqlserver2005的数据时一个错误">从oracle内访问sqlserver2005的数据时一个错误</a> (0)</li><li>2010-08-23 -- <a href="https://www.dbainfo.net/direct-modify-sqlserver-data-page-by-dbcc-writepage.htm" title="利用dbcc writepage命令修改SQL SQLSERVER中的物理页面上的内容">利用dbcc writepage命令修改SQL SQLSERVER中的物理页面上的内容</a> (3)</li><li>2010-08-17 -- <a href="https://www.dbainfo.net/sql-server-io-requests-taking-longer-than-15-seconds-to-complete-on-file.htm" title="[SQL SERVER] I/O requests taking longer than 15 seconds to complete on file">[SQL SERVER] I/O requests taking longer than 15 seconds to complete on file</a> (0)</li><li>2010-08-16 -- <a href="https://www.dbainfo.net/sqlserver2005-view-long-time-transacitons.htm" title="sql server 2005 中查找长事务的SQL语句">sql server 2005 中查找长事务的SQL语句</a> (0)</li><li>2010-08-16 -- <a href="https://www.dbainfo.net/sqlserver2005-long-transaction-contents.htm" title="查询sql server中的长时间运行的事务内容">查询sql server中的长时间运行的事务内容</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>https://www.dbainfo.net/sql2005-direct-update-system-catalogs.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
