is there any over head of begin try cahce ?

  • 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

  • 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.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • 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.

  • i thought like transaction blocks , so it will also block

    yours sincerely

  • rajemessage 14195 (6/21/2016)


    i thought like transaction blocks , so it will also block

    yours 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.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • thank u , but my query was , will try cache block any thing?

    yours sincerley

  • 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/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply