System.Data.SqlClient.ISQLDebug.SQLDebug Method (int32, int32, string, string, int32, int32, uint8 )
Enable SQL Server application debugging against a version of SQL Server prior to SQL Server 2005.
Function SQLDebug ( _
dwpidDebugger As Integer, _
dwpidDebuggee As Integer, _
pszMachineName As String, _
pszSDIDLLName As String, _
dwOption As Integer, _
cbData As Integer, _
rgbData As Byte() _
) As Boolean
bool SQLDebug (
int dwpidDebugger,
int dwpidDebuggee,
string pszMachineName,
string pszSDIDLLName,
int dwOption,
int cbData,
byte[] rgbData
)
Parameters
Parameter | Description |
---|---|
dwpidDebugger |
The process id of Visual Studio. |
dwpidDebuggee |
The process id of the client application. |
pszMachineName |
Name of machine running debugger. |
pszSDIDLLName |
Name of SDI DLL to load. For example, mssdi98.dll. |
dwOption |
1 to start debugging, 0 to stop debugging. |
cbData |
Count of bytes, must be less than 256. |
rgbData |
Data read inside the dwpidDebuggee process and send on to SQL server. Must begin with "{C36729C6-65AB-4a6f-8B96-53FF94E3A8D2}". |
Return Value
True if the call succeeds, otherwise false.
Remarks
Application debugging is making calls from a client application into a database, and you debug the SQL Server code running in the database. SQLDebug is used by a debugger to inform the SQL Server drivers (SqlClient) that the debugger is debugging a client application, and if this client application makes database calls, the driver should inform SQL Server that a debugger wants to debug these calls. The debugger will load the driver into some process to make these calls, usually the debugger’s process.
Legacy T-SQL application debugging is disabled by default beginning in SQL Server 2000 SP3. To enable, run sp_sdidebug 'legacy_on'. To disable, run sp_sdidebug 'legacy_off'. sp_sdidebug requires system administrator privilege. Legacy SQL application debugging is not secure.
This method can be accessed as via COM (CoCreate CLSID_SQLDebugging):
DEFINE_GUID(CLSID_SQLDebugging, 0xAFEF65AD, 0x4577, 0x447A, 0xA1, 0x48, 0x83, 0xAC, 0xAD, 0xD3, 0xD4, 0xB9);
[
object,
uuid(6CB925BF-C3C0-45B3-9F44-5DD67C7B7FE8),
version(1.0),
pointer_default(unique)
]
interface ISQLDebug : IUnknown {
HRESULT SQLDebug (
[in] DWORD dwpidDebugger,
[in] DWORD dwpidDebuggee,
[in] LPSTR pszMachineName,
[in] LPSTR pszSDIDLLName,
[in] DWORD dwOption,
[in] DWORD cbData,
[in] SAFEARRAY(unsigned char) rgbData,
[out, retval] VARIANT_BOOL* pRetVal); // true if successful
};
This export/interface exists in the following drivers:
SQLSRV32.DLL
NTWDBLIB.DLL
SQLOLEDB.DLL
System.Data.Dll
Version Information
.NET Framework
Supported in: 2.0