sp_helpdb的问题

zzxiaoma 2006-02-03 02:09:16
执行sp_helpdb时出现下面提示:
服务器: 消息 515,级别 16,状态 2,过程 sp_helpdb,行 53
无法将 NULL 值插入列 'owner',表 'tempdb.dbo.#spdbdesc___________________________________________________________________________________________________________00010000001F';该列不允许空值。INSERT 失败。
语句已终止。
执行第二次时出现:

服务器: 消息 515,级别 16,状态 2,过程 sp_helpdb,行 53
无法将 NULL 值插入列 '',表 '';该列不允许空值。INSERT 失败。
语句已终止。
这是什么原因?
用sp_helpdb 数据库名字 这个没有问题
...全文
589 13 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
terry52 2006-02-08
  • 打赏
  • 举报
回复
不能为空的列插入空值
zlp321002 2006-02-07
  • 打赏
  • 举报
回复
现象:

有一台测试环境的机器中,执行sp_helpdb,提示下面的错误信息。
不能向表 'tempdb.dbo.#spdbdesc___________________________________________________________________________________________________________00010002498F'的'owner'列插入空值。

Description:

This indicates a problem with your SQL Server installation. At least one of the databases on your database server has a missing or corrupt owner. The system stored procedure "sp_helpdb", which lists your existing databases, requires a valid owner for every database in order to run.

To see what's happening, open Query Analyzer and run: exec sp_helpdb. You will see an error message like the one above.

Common Cause:

Outside of SQL Server, the database owner's Windows account gets deleted. This sours things within SQL Server, it orphans that database.

Solution:

Following is the response I've seen two Microsoft reps post on groups. <dbname> is the database with the missing or corrupt owner.

1)
Use <dbname>
sp_changedbowner '[new user not in db already]'
--this will work & sp_helpdb will execute correctly

2) Then execute the same query using sa & it will work:
Use <dbname>
sp_changedbowner 'sa'
--The dependent aliases were mapped to the new database owner. Database owner changed.
Of course, you may not know which database has the problematic owner. Here's from a Microsoft Rep (view thread):

The database owner SID will become invalid if the owner's Windows account is
deleted. This causes problems with sp_helpdb because of the NULL account
name returned from SUSER_SNAME().. You can identify these problem databases
with the script below and correct the problem by executing sp_changedbowner
with a valid login.


SELECT name
FROM master..sysdatabases
WHERE SUSER_SNAME(sid) IS NULL


zzxiaoma 2006-02-07
  • 打赏
  • 举报
回复
up
zzxiaoma 2006-02-06
  • 打赏
  • 举报
回复
就只有那一句不会是这个问题
likang2008 2006-02-05
  • 打赏
  • 举报
回复
是不是没有选中sp_help 直接按F5了?
zzxiaoma 2006-02-05
  • 打赏
  • 举报
回复
up
zzxiaoma 2006-02-05
  • 打赏
  • 举报
回复
up
dagecc 2006-02-04
  • 打赏
  • 举报
回复
说明白一点阿
zlp321002 2006-02-04
  • 打赏
  • 举报
回复
--不空值插入了不允许为空的列,报告的错误 !
Button_lin 2006-02-04
  • 打赏
  • 举报
回复
你登入的用户名没有足够的权限执行sp_helpdb
人鱼传说 2006-02-04
  • 打赏
  • 举报
回复
关注,我的执行没问题,是不是你的master数据库存放database名的表出了问题
zzxiaoma 2006-02-04
  • 打赏
  • 举报
回复
够明白了吧在查询分析器里执行sp_helpdb出现上面的提示
zzxiaoma 2006-02-03
  • 打赏
  • 举报
回复
怎么没人知道啊

34,838

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧