Is there any way to use SQLSERVER SMO(sqlserver management Objects) in c++ other than Managed Code?
有没有办法在除托管代码之外的c ++中使用SQLSERVER SMO(sqlserver管理对象)?
Help me in this regard...
在这方面帮助我......
I sincerely request dont give the comment as duplicate still i am not getting Clear answer
我真诚地要求不要发表评论,因为重复仍然没有得到明确的答案
1 个解决方案
#1
As you pointed out. This question has already been asked without a satisfactory answer.
正如你所指出的那样。在没有令人满意的答案的情况下已经提出这个问题
SMO is strictly manage code. The previous version, DMO, could be used in unmanaged code. If you need to use SMO, you have to use either C++/CLI or create wrappers for COM.
SMO严格管理代码。以前的版本DMO可用于非托管代码。如果需要使用SMO,则必须使用C ++ / CLI或为COM创建包装器。
From the MSDN Documentation on SMO:
从SMO上的MSDN文档:
The SMO object model supersedes and replaces SQL-DMO. SMO supports SQL Server 2000, SQL Server 2005, and SQL Server 2008. It supports more SQL Server management tasks and contains many new features in SQL Server. SMO is designed to be more efficient and provide more control.
SMO对象模型取代并替换SQL-DMO。 SMO支持SQL Server 2000,SQL Server 2005和SQL Server 2008.它支持更多SQL Server管理任务,并包含SQL Server中的许多新功能。 SMO旨在提高效率并提供更多控制。
The DMO library is a COM object model, whereas SMO is implemented as a .NET Framework assembly. COM components are libraries that provide re-usable functionality to applications and in unmanaged application programming. The .NET Framework assemblies provide reusable functionality for the .NET Framework to write managed code applications.
DMO库是COM对象模型,而SMO是作为.NET Framework程序集实现的。 COM组件是为应用程序和非托管应用程序编程提供可重用功能的库。 .NET Framework程序集为.NET Framework提供可重用的功能,以编写托管代码应用程序。
During the transition to .NET Framework technology it is possible to have applications written partly in managed code and partly in unmanaged code. The .NET Framework lets you interface with COM components, which requires a Primary Interop Assembly. A runtime wrapper is required for SQL-DMO so that it can be called from a .NET Framework -based application.
在向.NET Framework技术过渡期间,可以将应用程序部分编写在托管代码中,部分编写在非托管代码中。 .NET Framework允许您与COM组件进行交互,这需要主Interop程序集。 SQL-DMO需要运行时包装器,以便可以从基于.NET Framework的应用程序调用它。
#1
As you pointed out. This question has already been asked without a satisfactory answer.
正如你所指出的那样。在没有令人满意的答案的情况下已经提出这个问题
SMO is strictly manage code. The previous version, DMO, could be used in unmanaged code. If you need to use SMO, you have to use either C++/CLI or create wrappers for COM.
SMO严格管理代码。以前的版本DMO可用于非托管代码。如果需要使用SMO,则必须使用C ++ / CLI或为COM创建包装器。
From the MSDN Documentation on SMO:
从SMO上的MSDN文档:
The SMO object model supersedes and replaces SQL-DMO. SMO supports SQL Server 2000, SQL Server 2005, and SQL Server 2008. It supports more SQL Server management tasks and contains many new features in SQL Server. SMO is designed to be more efficient and provide more control.
SMO对象模型取代并替换SQL-DMO。 SMO支持SQL Server 2000,SQL Server 2005和SQL Server 2008.它支持更多SQL Server管理任务,并包含SQL Server中的许多新功能。 SMO旨在提高效率并提供更多控制。
The DMO library is a COM object model, whereas SMO is implemented as a .NET Framework assembly. COM components are libraries that provide re-usable functionality to applications and in unmanaged application programming. The .NET Framework assemblies provide reusable functionality for the .NET Framework to write managed code applications.
DMO库是COM对象模型,而SMO是作为.NET Framework程序集实现的。 COM组件是为应用程序和非托管应用程序编程提供可重用功能的库。 .NET Framework程序集为.NET Framework提供可重用的功能,以编写托管代码应用程序。
During the transition to .NET Framework technology it is possible to have applications written partly in managed code and partly in unmanaged code. The .NET Framework lets you interface with COM components, which requires a Primary Interop Assembly. A runtime wrapper is required for SQL-DMO so that it can be called from a .NET Framework -based application.
在向.NET Framework技术过渡期间,可以将应用程序部分编写在托管代码中,部分编写在非托管代码中。 .NET Framework允许您与COM组件进行交互,这需要主Interop程序集。 SQL-DMO需要运行时包装器,以便可以从基于.NET Framework的应用程序调用它。