Home Forums SQL Server 2012 SQL Server 2012 - T-SQL can i use set xact_abort on, in place of begin try cashe to rollback, in reporting stored proc becasue they do not insert update in database. RE: can i use set xact_abort on, in place of begin try cashe to rollback, in reporting stored proc becasue they do not insert update in database.

  • since you have already set the isolation level to read uncommitted, the only thing a SELECT statement will do (assuming "-- report stmt" is really a select)

    is to take out a schema lock to prevent the table(s) from being modified DDL-wise until the proc completes.

    it's more likely that other items are competing for the same table resources.

    if the queries are poorly written or inefficient as far as indexes go, they might take a long time; i'd say a round of query tuning is much more relevant. a try-catch for a select statement would only be useful of the tables or columns are disappearing and reappearing. if hte tables existance is static, a select statement wouldn't really need a try-catch.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!