SQL Server Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘management objects’

FIX: Scripting Object with Several Extended Properties May Cause Exception

Symptoms
When you attempt to script an object that has a number of large, string descriptions for the value field of its extended properties, an access violation exception may occur, resulting in failure to generate the script. This problem only occurs if you have requested to script the object’s extended properties when generating the script.
An error message similar to the following occurs:

[SQL-DMO]Code execution exception: EXCEPTION_ACCESS_VIOLATIONYou may encounter this problem when you try to script the object by using SQL Server Enterprise Manager or the Query Analyzer Object Browser, or if you are using the Script method in a SQL Distributed Management Objects (DMO) application.
Resolution
The length of the text for the values of the extended properties are long enough so that an internal buffer being used for building the script text is overrun.

How to use the new functionalities of the SQL Server 2008 version of SMO in an application that uses the SQL Server 2005 version of SMO

Symptoms
In Microsoft SQL Server 2008, new functionalities are added to SQL Server Management Objects (SMO). An application that uses the SQL Server 2005 version of SMO cannot be compiled by using the SQL Server 2008 version of SMO. You must make some changes to the application, and then you must recompile the application. Then, you can use the new functionalities in the SQL Server 2008 version of SMO.
Resolution
This article describes what you must do to use the new functionalities of the SQL Server 2008 version of SMO in an application that uses the SQL Server 2005 version of SMO.

FIX: You cannot use the SQL Server 2008 version of SMO to manage certificates in SQL Server 2005 and in SQL Server 2000

Symptoms
You try to manage certificates in Microsoft SQL Server 2005 and in SQL Server 2000 by using the SQL Server 2008 version of SQL Server Management Objects (SMO). An exception is raised, and SMO does not let you manage the certificates.
Resolution
This problem occurs because SQL Server 2008 has a specific property that SMO looks for when you try to manage certificates. However, SMO does not verify which version of SQL Server owns the certificates, and when it tries to initialize this SQL Server 2008 specific property, SMO raises the exception.