How do I call tracelog from inside SQL server stored procedures?
Step 1 – create the stored procedure below: CREATE PROCEDURE Trace @Name varchar(70), @Desc varchar(70) = ” as BEGIN SET NOCOUNT ON DECLARE @object int DECLARE @hr int EXEC @hr = sp_OACreate ‘Trace32.Tracelog’, @object OUT if @HR=0 EXEC sp_OAMethod @object, ‘Add’, NULL, @Name, @Desc RETURN 0 END Step 2 – The Transact SQL required to trace is…
Related Questions
- Is there a single database file housing all the data, data definitions, stored procedures, security, table relationships, etc. as in Microsoft’s SQL server?
- Is it a good practice to use SQL Server stored procedures for INSERT, UPDATE, and DELETE statements?
- Is there a problem with Connection pooling and stored procedures?