views:

204

answers:

3

When I try to add a data-base in SQL Server 2008 (Right clicking on Databases folder->New Database) the only compatibility options given to me in the options tab are 70, 80, and 90.

However, I require the use of the DATE object, which doesn't work unless I set the compatibility level to 100.

I've tried using exec sp_dbcmptlevel mydb, 100; GO

However, I get the following error: Valid values of the database compatibility level are 60, 65, 70, 80, or 90.

What I am missing here?

A: 

Leave it blank. Compatibility level is there to allow you to set the compatibility to a lower version of the database (if you need to).

Gabriel McAdams
Are you saying that it defaults to 100?Also, what do you mean 'leave it blank'? the drop-down menu in the options tab does not have a blank option just 70,80,90.
snwr
The options menu starts out blank (if not, then it might be a 2005 server)
Gabriel McAdams
@Gabriel: Not for me, whether it's 2005 or 2008...
bdukes
Make sure you're connecting to a 2008 version of the database server (whether or not you're using SSMS 2005 or 2008)
Gabriel McAdams
I hate to sound like a terrible noob here but I have looked but cannot find where I can pick the specific version of the db server I want to connect to.
snwr
That's not a choice you have. It depends on what is installed. What does it say next to the server name in the Object Explorer window? (something like servername (SQL Server 9.0.4035 - loginname)
Gabriel McAdams
@bdukes: You're right, its blank for me because I'm using SSMS 2005 - in 2008, it should have an option for 2008 (100)
Gabriel McAdams
My server name had SQLEXPRESS attached to it...getting rid of that when i connect defaulted my version to 10.Thanks to the both of you, you've been fantastic help.
snwr
That means you have 2 versions installed. 2008 and 2005 express.
Gabriel McAdams
Yeah the funny thing is I don't know where the 2005 express even came from. I suspect it may have been installed during the visual studio install and I didn't catch it.
snwr
Yeah. Its installed with Visual Studio.
Gabriel McAdams
A: 

From your description, it certainly appears that the database is a SQL Server 2005 database, not SQL Server 2008. Does it have a "100.something" next to the server name? If not, it's not SQL Server 2008.

Are you using SQL Server 2008 Management Studio, or an earlier version?

bdukes
I think you're onto something here.I just checked my version with select @@version and it returnsMicrosoft SQL Server 2005 - 9.00.3042.00 (Intel X86) Feb 9 2007 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 6.1 (Build 7600: ) However I am using SQL Server 2008 Management Studio (even double checked via help-about dialogue).
snwr
SQL Server Management Studio can connect to older server versions, but the version of the server is the important part, in terms of whether it supports the `date` date type, etc.
bdukes
A: 

Have you by chance tried the following?

ALTER DATABASE [DatabaseName] SET COMPATIBILITY_LEVEL = 100
Nate