Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
gokula_k
Starting Member
3 Posts |
Posted - 2015-03-05 : 22:31:46
|
Hi,Problem:I want to set compatibility_level only when it is greater than 110.Solution:Select the compatibility level and if it is greater than 110, I alter database set compatibility level=110ISSUEIrrespective of IF Exist statement the alter database statement is executed all the time.Here is the sql statementIF EXISTS (SELECT * FROM sys.databases where compatibility_level >110 AND name='mydatabase')BEGINALTER DATABASE mydatabase SET COMPATIBILITY_LEVEL = 110ENDWhat is that I am missing here ??please support. |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2015-03-06 : 07:19:45
|
Please do not cross post:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=200146 |
|
|
|
|
|