Will SQL-DMO work with the final version of SQL Server 2012?

Answered Will SQL-DMO work with the final version of SQL Server 2012?

  • 30 พฤศจิกายน 2554 11:57
     
     

    With SQL Server 2012 RC 0 it still seems to work.

    If it won't work with the final version, what other API is recommended to use in non-managed C++ code?

ตอบทั้งหมด

  • 30 พฤศจิกายน 2554 23:10
    ผู้ดูแล
     
     

    Hello,

    I just found that link ( which is not clear for me , i suppose mainly because of my poor english )

    http://msdn.microsoft.com/en-us/library/ms190461(v=SQL.110).aspx

    you will find

    "Note than beginning in Microsoft SQL Server 2012 Release Candidate 0 (RC 0), DMO has been removed from SQL Server"

    DMO was no more installed with SQL Server 2008 Express, a way to push people to jump from DMO to SMO

    Don't hesitate to post again for more help or explanations

    Have a nice day

    PS : To your question "what other API is recommended to use in non-managed C++ code ?", i am fearing that the answer is NONE as SMO needs managed code. So , if you want to use your non-managed VC++ code, you have only the solution to execute T-SQL queries inside your code ( but i don't know how the .Net Framewordk 4.0 is behaving with non-managed code, especially for the class SqlCommand )

    Have a nice day


    Mark Post as helpful if it provides any help.Otherwise,leave it as it is.
    • แก้ไขโดย Papy NormandModerator 30 พฤศจิกายน 2554 23:18 Added PS
    • ทำเครื่องหมายเป็นคำตอบโดย KJian_ 7 ธันวาคม 2554 2:51
    • ยกเลิกการทำเครื่องหมายเป็นคำตอบโดย psc161 7 ธันวาคม 2554 7:34
    •  
  • 1 ธันวาคม 2554 7:52
     
     
    Well, DMO has been marked as deprecated since SQL Server 2005, but I have used the version, which is available as a separate download, successfully with 2005, 2008, 2008 R2 and 2012 RC 0.

    It's odd that Microsoft is shifting backwards to non-managed code with Windows 8 and the next version of Visual Studio, but provides no supported native API for managing SQL Server.
  • 16 ธันวาคม 2554 16:09
     
     

    I too also find this odd, because their OMPM (Office Migration Planning Manager for Office 2010) requires DMO to be installed...

    Do as I say, not as I do??

  • 8 สิงหาคม 2555 3:02
     
     คำตอบ

    Based on my findings the SQL Server 2012 production release does no longer support SQL-DMO.

    It is not part of its Feature Pack either: http://www.microsoft.com/downloads/details.aspx?FamilyID=327CDA8D-2AD7-43F9-9746-34AC718F658D&displaylang=pt-br&displaylang=en


    Arthur My Blog

  • 29 ตุลาคม 2555 15:05
     
     

    This is very weird. Our setup (which is a very complex beast, written in InstallScript) is based on the use of SQL-DMO to install all our database objects. I've tested this setup with SQL Server 2012 version 11.0.2100.60 and this works ok. I'll provide some code snippets of SQL-DMO commands that we use.

    1)
        set oNewDatabase = CoCreateObject("SQLDMO.Database2");
        set oDBFileData = CoCreateObject("SQLDMO.DBFile");
        set oLogFile = CoCreateObject("SQLDMO.LogFile");
        set oDBOption = CoCreateObject("SQLDMO.DBOption2");

        //Set new database name
        szTrimChars = "[]";
        StrTrimA(szSQLdatabase, szTrimChars);
        oNewDatabase.Name = szSQLdatabase;

        //Create new database with default properties
        ogSQL_Server.Databases.Add(oNewDatabase);

    2)

        set oQueryResults = ogSQL_Database.ExecuteWithResultsAndMessages2(szSQL, szMsg);
        WriteLogLine(szMsg, INFORMATION);

    I don't understand, because I assumed SQL-DMO was no longer supported. I know it was deprecated in 2005, obsolete in 2008 and now in 2012 discontinued. But apparently it still works after installing the SQL 2005 Backward Compatibliity pack.

    Has someone any clue why this still works to create databases and run scripts through SQL-DMO?

    Thanks in advance.

  • 27 พฤศจิกายน 2555 21:15
     
     คำตอบ

    The deprecation/discontinue notices cover the fact that the programming DMO libraries and DLLs were removed, first from parts of SQL Server 2008 R2 and fully from SQL 2012. But both DMO and SMO operate by building Transact-SQL batches they transmit to SQL Server using the same TDS protocol used by the ADO, ODBC, and other client drivers. The DB engine just runs whatever Transact-SQL statements it finds in the TDS packets.

    There are two compatibility issues though:

    1. DMO was frozen in SQL Server 2000. DMO has no code to support features introduced in SQL Server 2005 or later. With each release there are more things in the DB engine that DMO cannot handle.
    2. At some point a future release of the DB Engine will no longer support the version of TDS emitted by DMO. DMO-based tools and applications will stop working whenever that happens.
    • ทำเครื่องหมายเป็นคำตอบโดย Papy NormandModerator 10 มกราคม 2556 23:31
    •  
  • 17 ธันวาคม 2555 9:39
     
     

    Alan,

    Thank you very much for you clear answer!

    Kr