locked
SSMS scripting Objects - Script for ServerVersion RRS feed

  • Question

  • Fellow SQLers.

    This may sound like an odd question but if you are using SSMS and generating scripts for the db objects, one of the options to select is "Script for Server Version".  Does this mean to pick what version it currently is or what version you are go to generate it to load on?

    For example, if I was going to restore something from SQL 2008 r2 to SSQL 2008r2, I would pick SQL 2008r2.

    But if I was going to script a db from SSQL 2008 r2 and restore it on SQL 2016, would I pick SQL 2016 for this option?

    Thanks,

    MG

    Friday, November 8, 2019 12:24 PM

Answers

  • Hi

    Your understanding is correct. When we say "Script for Server Version" it means the target SQL Server that you willing to run the generated scripts.

    Hope this is helpful !!

    Thank you


    If this post helps to resolve your issue, please click the "Mark as Answer" of that post and/or click Answered "Vote as helpful" button of that post. By marking a post as Answered and/or Helpful, you help others find the answer faster.

    • Marked as answer by mg101 Friday, November 8, 2019 2:32 PM
    Friday, November 8, 2019 1:21 PM

All replies

  • Hi

    Your understanding is correct. When we say "Script for Server Version" it means the target SQL Server that you willing to run the generated scripts.

    Hope this is helpful !!

    Thank you


    If this post helps to resolve your issue, please click the "Mark as Answer" of that post and/or click Answered "Vote as helpful" button of that post. By marking a post as Answered and/or Helpful, you help others find the answer faster.

    • Marked as answer by mg101 Friday, November 8, 2019 2:32 PM
    Friday, November 8, 2019 1:21 PM

  • But if I was going to script a db from SSQL 2008 r2 and restore it on SQL 2016, would I pick SQL 2016 for this option?

    Thanks,

    MG

    From the MS document:

    Script for server version - Creates a script that can be run on the selected version of SQL Server. Features new to a version cannot be scripted for earlier versions. The default is the version of the origin server.


    Regards,
    Vaibhav

    Friday, November 8, 2019 1:44 PM
  • Thanks NKumar
    Friday, November 8, 2019 2:33 PM