Captured this in SQL Profiler, being sent from a 3rd party app. What is it doing?
declare @p1 int
set @p1=180150003
declare @p3 int
set @p3=8
declare @p4 int
set @p4=1
declare @p5 int
set @p5=34
exec sp_ddopen @p1 output,N'sp_sproc_columns',@p3 output,@p4 output,@p5 output,N'some_stored_procedure_name',NULL,NULL,NULL
select @p1, @p3, @p4, @p5
edit: my best guess: Its an ODBC driver asking for the parameters that a stored procedure needs.
Here’s the source code for sp_ddopen, apparently.
edit2: the setting of the @p parameters before the exec is an artifact of the Sql Profiler apparently. In its original form, the sp_ddopen would have been called with all parameters being null, and they would have returned the values shown.
According to MS (see http://msdn.microsoft.com/en-us/library/ms187961.aspx) this is an internal stored procedure which is NOT officially documented… it operates on the internal DB catalog (metadata for DB objects) and is used for example by the SQL Server ODBC driver when you/some app calls
SQLTablesorSQLTablesW(see for example http://support.microsoft.com/kb/315761/en-us).Thus I would think that your guess is right 🙂