Create Database in SQL Server 2012, Script and Use in 2008?

后端 未结 3 677
你的背包
你的背包 2020-12-16 02:42

If I create a database using 2012 and work and add that info to it, if I were to script the database after, would I be able to run the script in 2008 and have everything wor

3条回答
  •  情歌与酒
    2020-12-16 02:53

    A script? Yes. Well, let me rephrase: it depends. As long as your objects don't use any 2012-specific features, you will be able to script out the schema using Management Studio or a variety of 3rd party tools (I blogged about some options here). Many of the tools also offer options (or companion tools) to also script the data.

    The problem is there isn't a very easy way in SQL Server 2012 to identify all of the places where you might be using 2012-specific features. For example, I don't know of a tool that will inspect your database and point out that you are using the FORMAT() function, which is not available in SQL Server 2008 or 2008 R2.

    Other means of copying the database over - backup/restore, attach/detach, mirroring/log shipping etc. will not work. You can go up (from 2005, 2008 or 2008 R2) to 2012, but you can't go backwards.

    So in general I agree with John. Much safer to develop on a version <= deployment version. Why would you want to develop on 2012 to deploy to 2008? Seems quite risky to me.

提交回复
热议问题