Reference Microsoft.SqlServer.Smo.dll

前端 未结 11 1231
轮回少年
轮回少年 2020-12-04 11:59

I need to use Server class which is stored in Microsoft.SqlServer.Smo.dll I don\'t see this assembly in usual References dialog. I have found it at C:/Program Files/Microsof

相关标签:
11条回答
  • 2020-12-04 12:37

    Microsoft.SqlServer.SqlManagementObjects NuGet package seams like the official way to install it after SQL Server 2017

    0 讨论(0)
  • 2020-12-04 12:38

    C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies is the correct folder location (or C:\Program Files (x86)\Microsoft SQL Server\100\SDK\Assemblies on 64-bit systems).

    You need to add references to:

    • Microsoft.SqlServer.ConnectionInfo.dll

    • Microsoft.SqlServer.Smo.dll

    • Microsoft.SqlServer.Management.Sdk.Sfc.dll

    • Microsoft.SqlServer.SqlEnum.dll

    (These are the minimum files that are required to build an SMO application)

    For SQL Server 2016, this location is C:\Program Files (x86)\Microsoft SQL Server\130\SDK\Assemblies (for the 64bit version).

    Ref.: How to: Create a Visual C# SMO Project in Visual Studio .NET

    The SQL Server Management Objects (SMO) are downloadable as part of the relevant SQL Server (20XX) Feature Pack (check the smallprint as I don't believe these are redistributable?)

    0 讨论(0)
  • 2020-12-04 12:41

    You can use: https://www.nuget.org/packages/Microsoft.SqlServer.SqlManagementObjects see installation info: https://docs.microsoft.com/nl-be/sql/relational-databases/server-management-objects-smo/installing-smo

    but no idea if this is redistributable...

    as it only talks about design, develop and testing:

    1. INSTALLATION AND USE RIGHTS. You may install and use any number of copies of the software on your devices to design, develop and test your programs.

    https://docs.microsoft.com/nl-be/sql/relational-databases/server-management-objects-smo/smo-license-terms

    0 讨论(0)
  • 2020-12-04 12:42

    You need to install following package to solve the problem , I have solved this problem twice with this package hope it may work for everyone too...

    Microsoft SQL Server 2005 Management Objects Collection The Management Objects Collection package includes several key elements of the SQL Server 2005 management API, including Analysis Management Objects (AMO), Replication Management Objects (RMO), and SQL Server Management Objects (SMO). Developers and DBAs can use these components to programmatically manage SQL Server 2005.

    You can get from Feature Pack for Microsoft SQL Server 2005 - December 2008 from Microsoft site [http://www.microsoft.com/en-us/download/details.aspx?id=11988][1] But the link location of download page changes every-time if you don't find resource you can download it from my blog too.

    I have also provided some tips and resources about this in my blog if you want http://rndp-android.blogspot.com/p/missing-microsoftsqlservermanagementsdk.html

    0 讨论(0)
  • 2020-12-04 12:44

    Hmm. Try registering the DLL library by running this at the DOS prompt (I'm curious as to why it's not registered already. I tried using it on a Windows that had SQL2008 installed and didn't have your problem)

    "c:\windows\system32\regsvr32.exe C:/Program Files/Microsoft SQL Server/100/SDK/Assemblies/Microsoft.SqlServer.Smo.dll"

    You need the quotation marks because of the spaces in the directory names.

    If you're running a 64-bit Windows, regsvr32.exe will be in C:\windows\syswow64\

    Best of luck. Let us know if this won't help.. Thanks.

    0 讨论(0)
  • 2020-12-04 12:48

    You can try this unofficial nuget package...

    https://www.nuget.org/packages/Unofficial.Microsoft.SQLServer.SMO/

    Install-Package Unofficial.Microsoft.SQLServer.SMO

    0 讨论(0)
提交回复
热议问题