首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

设备激活异常

2012-04-03 
设备激活错误。在查询分析器中用代码创建数据库时出现如下错误:服务器:消息5105,级别16,状态2,行3设备激活

设备激活错误。
在查询分析器中用代码创建数据库时   出现如下错误:

服务器:   消息   5105,级别   16,状态   2,行   3
设备激活错误。物理文件名   'D:\project\stuDB_data.mdf '   可能有误。
服务器:   消息   1802,级别   16,状态   1,行   3
CREATE   DATABASE   失败。未能创建所列出的某些文件名。请检查前面的错误信息。

请教高手如何解决,是哪里出了问题,代码不会错:
if   exists(select   *   from   sysdatabases   where   name= 'studb ')
drop   database   studb
go
create   database   studb
on   primary
(
name=studb_data,
filename   = 'D:\project\studb_data.mdf ',
size=5mb,
filegrowth=15
)
log   on
(
name=studb_log,
filename= 'D:\project\studb_log.ldf ',
size=5mb,
filegrowth=15
)
go

在线等     谢谢

[解决办法]
我记得不用加引号的,这里没有环境,你把primary去掉试试看
[解决办法]
有沒有D:\project這個文件夾?
[解决办法]
http://support.microsoft.com/?id=836873

CAUSE
This problem occurs because the DefaultData and DefaultLog registry values that correspond to the default data directory and to the default log directory exist, but the folder paths that are mentioned in the registry values are either blank or do not exist.


To work around this problem, use one of the following methods:
Set the default data directory value and the default log directory value to valid folder paths
You can set the default data directory value and the default log directory value by using either SQL Server Enterprise Manager or Registry Editor.

[解决办法]
up
[解决办法]
你沒有D:\project這個文件夾吧?要不是不会错的

热点排行