SQL Server: Cannot find data type date and unable to set compatibility

人盡茶涼 提交于 2019-12-10 15:45:25

问题


I have a install script that uses DATE. I'm running SQL Server 2008 R2, and it doesn't like the date type.

Msg 2715, Level 16, State 7, Line 1
Column, parameter, or variable #3: Cannot find data type date.

So I tried setting the compatibility of the database to 100 using the following:

ALTER DATABASE znode_multifront SET COMPATIBILITY = 100

I receive the following error:

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '100'.

So I tried going into SQLCMD mode and used the following:

EXEC sp_dbcmptlevel znode_multifront, 100;

Which produced the following error:

Msg 15416, Level 16, State 1, Procedure sp_dbcmptlevel, Line 70
Usage: sp_dbcmptlevel [dbname [, compatibilitylevel]]

I am very new to SQL Server. Any help would be greatly appreciated.


回答1:


alter database znode_multifront
set compatibility_level = 100
go

You were close. The set option is COMPATIBILITY_LEVEL, not COMPATIBILITY like you have in your original post.

You will need ALTER permission on the database to execute the above query.



来源:https://stackoverflow.com/questions/8744455/sql-server-cannot-find-data-type-date-and-unable-to-set-compatibility

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!