Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mksdf
Starting Member
26 Posts |
Posted - 2015-02-26 : 07:46:28
|
Hi I am getting an error with this code but I have no idea why it would produce the error.The error is: An expression of non-boolean type specified in a context where a condition is expected, near '('.but I cant see why it doesn't like IF @@TRANCOUNT() > 0. Does anyone have any ideas?Thanks DECLARE @SQL NVARCHAR(MAX) BEGIN TRY BEGIN TRANSACTION EXECUTE DB.dbo.usp_test @x, @y COMMIT TRANSACTION END TRY BEGIN CATCH IF @@TRANCOUNT() > 0 ROLLBACK TRANSACTION DECLARE @ErrorMessage NVARCHAR(4000) SET @ErrorMessage = ERROR_MESSAGE() SELECT @ErrorMessage Message END CATCH |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2015-02-26 : 08:03:59
|
@@TRANCOUNT is used without "()" Too old to Rock'n'Roll too young to die. |
|
|
|
|
|