J
jim_adams
Given a technique similar to the following, instead of actually
executing the Stored Procedure, I need the resulting SQL command string
written to a file and then manually executed in Query Analyzer.
Dim objSqlConn As New SqlClient.SqlConnection
Dim objSqlDA As New SqlClient.SqlDataAdapter
Dim objSqlCmd As New SqlClient.SqlCommand
objSqlConn = New SqlConnection(strSqlConn)
With objSqlCmd
objSqlConn.Open()
.CommandTimeout = CommandTimeout
.CommandType = CommandType.StoredProcedure
'Add some SPROC parameters
.Parameters.Add(DbParameter)
.CommandText = Command
.Connection = objSqlConn
End With
objSqlDA.SelectCommand = objSqlCmd
if blnWriteToScriptFile then
'How to do this????????
else
objSqlDA.Fill(objDS)
end if
Any ideas are greatly appreciated?
Thanks,
Jim
executing the Stored Procedure, I need the resulting SQL command string
written to a file and then manually executed in Query Analyzer.
Dim objSqlConn As New SqlClient.SqlConnection
Dim objSqlDA As New SqlClient.SqlDataAdapter
Dim objSqlCmd As New SqlClient.SqlCommand
objSqlConn = New SqlConnection(strSqlConn)
With objSqlCmd
objSqlConn.Open()
.CommandTimeout = CommandTimeout
.CommandType = CommandType.StoredProcedure
'Add some SPROC parameters
.Parameters.Add(DbParameter)
.CommandText = Command
.Connection = objSqlConn
End With
objSqlDA.SelectCommand = objSqlCmd
if blnWriteToScriptFile then
'How to do this????????
else
objSqlDA.Fill(objDS)
end if
Any ideas are greatly appreciated?
Thanks,
Jim