Posts

Showing posts with the label programming sql

How to find a error line in SQL

BEGIN TRY -- Generate a divide-by-zero error. SELECT 1/0; END TRY BEGIN CATCH SELECT ERROR_LINE() AS ErrorLine; END CATCH;

Division Operation In SQL

declare @a int,@b int declare @C float set @a = 100 set @b=200 set @c= cast(@a as float)/cast(@b as float) print @C