views:

18

answers:

3
Declare @strxml varchar(max) = ''

This is the newly added feature in sql server 2008 which allows us to initialize the variables at declaration itself.

When I'm executing these commands in sql management studio 2005 I'm getting aN error message.

"Cannot assign a default value to a local variable."

A: 

Well, yes, you will receive an error message as this is available in Sql Server 2008, not 2005

Even if you are to use SSMS 2008, linked to an older version of Sql Server 2005 and less, you CANNOT use any of the features available on the Server 2008

astander
A: 

But at the end of the day any sql command gets executed in the server not in the client. In that way 2008 features should be available in the Management studio.

Sunil
+1  A: 

Check that the "database compatibility level" setting in your dabase is set to 100 (SQL-Server 2008). Depending on how you got the database transferred to the new server this may NOT be the case. If it's not, you can't use most of the new features. Especially Backup+Restore keeps the setting at it's OLD value (90 for SQL Server 2005) even if you restore to SQL Server 2008.

Oliver

related questions