June 20, 2016 at 9:35 am
hi,
i wanted to know , is there any overhead of begin try cache,
like is there any situation it takes more resources , so i will use it causesly.
yours sincerely
June 20, 2016 at 9:53 am
rajemessage 14195 (6/20/2016)
hi,i wanted to know , is there any overhead of begin try cache,
like is there any situation it takes more resources , so i will use it causesly.
yours sincerely
There's no significant overhead, but you should use it correctly. Using error handling without actually handling the errors is just a waste of development time.
June 20, 2016 at 9:54 am
If you execute t-sql in a try catch block then you should notice no difference between this and executing the same T-sql outside of a try catch block.
The performance overhead could happen when an error occurs and processing moves to the catch block depending on what you are doing in the catch block.
June 21, 2016 at 9:46 am
i thought like transaction blocks , so it will also block
yours sincerely
June 21, 2016 at 10:14 am
rajemessage 14195 (6/21/2016)
i thought like transaction blocks , so it will also blockyours sincerely
Blocking is not a bad thing. It's used to keep data integrity.
Excessive blocking is a problem and it's caused by excessive locking, which is caused by bad queries and db design. You just need to tune the queries and have the correct indexes and table design.
June 22, 2016 at 8:06 am
thank u , but my query was , will try cache block any thing?
yours sincerley
June 22, 2016 at 8:29 am
rajemessage 14195 (6/22/2016)
thank u , but my query was , will try cache block any thing?yours sincerley
TRY...CATCH... won't block. Locks can block and locks are issued by SELECTs, DML and DDL.
Here's a nice guide on locking for SQL Server: http://aboutsqlserver.com/2011/09/28/locking-in-microsoft-sql-server-table-of-content/
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply