SQL 语句执行错误分析原因
语句如下,其中ETeam-PMS-DB为数据库名,该语句在查询分析器中可执行,但在企业管理器中无法添加作业进行自动执行.SELECT*FROMETeam-PMS-DB.d...
语句如下,其中ETeam-PMS-DB为数据库名,该语句在查询分析器中可执行,但在企业管理器中无法添加作业进行自动执行.SELECT * FROM ETeam-PMS-DB.dbo.sysfiles
use ETeam-PMS-DB
BACKUP LOG ETeam-PMS-DB WITH TRUNCATE_ONLY
DBCC SHRINKFILE(ETeam-PMS-DB_Log,10)
错误提示如下:
---------------------------
Edit Job Step - (local)\clearETeam-PMS-DB
---------------------------
The Server detected the following syntax errors in the command:
Error 911: Could not locate entry in sysdatabases for database 'ETeam'. No entry found with that name. Make sure that the name is entered correctly.
Line 1: Incorrect syntax near '-'.
Are you sure this is what you want?
---------------------------
Yes No
---------------------------
经查为数据库命名中不能有"-",是否为这个原因,查为什麽能在查询分析器中执行,出高分请高手解答. 展开
use ETeam-PMS-DB
BACKUP LOG ETeam-PMS-DB WITH TRUNCATE_ONLY
DBCC SHRINKFILE(ETeam-PMS-DB_Log,10)
错误提示如下:
---------------------------
Edit Job Step - (local)\clearETeam-PMS-DB
---------------------------
The Server detected the following syntax errors in the command:
Error 911: Could not locate entry in sysdatabases for database 'ETeam'. No entry found with that name. Make sure that the name is entered correctly.
Line 1: Incorrect syntax near '-'.
Are you sure this is what you want?
---------------------------
Yes No
---------------------------
经查为数据库命名中不能有"-",是否为这个原因,查为什麽能在查询分析器中执行,出高分请高手解答. 展开
展开全部
不是我专业,没办法解答,来这个网站看看,给这位blog留言也许他可以帮助到您!
http://blog.163.com/lgh_2002/blog/static/440175262007102511246481/
http://blog.163.com/lgh_2002/blog/static/440175262007102511246481/
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
'-'处有语法错误...
use master
go
...
再仔细检查一遍吧
use master
go
...
再仔细检查一遍吧
参考资料: http://bbs.54master.com/index.php
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你最好还是别用带"-"的字符串来命名数据库吧,我这里就是查询分析仪里都不能识别这个数据库名,根据提示<Could not locate entry in sysdatabases for database 'ETeam'. No entry found with that name. Make sure that the name is entered correctly. >他是把ETeam当作是数据库名了,自然也就找不到这个数据库,而"-"后的-PMS-DB没有被认为是数据库名的一部分,看来在解析的时候他是把"-"后的字符串截断了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询