duchovnick
Programmer
I wrote a procedure as follows:
If @table1 exists i get 'a' as expected. If it doesnt exist i get an error message:
Could you please help me with that ?
Code:
/*EXEC complete_month_magazin v9*/
/*DROP PROC complete_month_magazin*/
CREATE PROCEDURE complete_month_magazin @table1 VARCHAR(10)
AS
BEGIN TRANSACTION
DECLARE @myDynamicSQL VARCHAR(900)
BEGIN
IF EXISTS (SELECT * FROM sysobjects WHERE name=@table1)
PRINT 'a'
ELSE
PRINT 'b'
Return
END
COMMIT
GO
I put a second "commit" at every corner of that short procedure and cannot get rid of that error.Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 3, current count = 4.
Could you please help me with that ?