Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.
SMO Scripter generated script does not run on SQL 2000

الإجابة SMO Scripter generated script does not run on SQL 2000

  • miércoles, 30 de noviembre de 2005 14:54
     
     
    I seem to be running into a problem getting a script (of the entire db) generated by SMO to run on 2000.  It looks like it puts all kinds of SQL 2005 specific TSQL in the script, which fails on 2000.  Any ideas?

    Angelo

Todas las respuestas

  • miércoles, 30 de noviembre de 2005 23:54
     
     Respondida

    SMO allows you to set the target version. When the version is set to Version80, SMO will filter out or alter the DDL as appropiate. For example, if you are using the Transfer class, you can do the following:

    Transfer
    trans = new Transfer(db);
    trans.Options.TargetServerVersion = SqlServerVersion.Version80;

    I am not sure of your exact scenario, but if this does not help you please be more specific on what you are trying to do.

    Peter

  • jueves, 01 de diciembre de 2005 4:35
     
     
    Thanks Peter,

    I can't believe I missed that. Looks like it did the trick.

    Angelo