Forum Replies Created

Viewing 15 posts - 11,341 through 11,355 (of 13,469 total)

  • RE: stored proc

    to do it the hardway, you have to check @@error after each update/insert: each command changes the @@error:

    ALTER procedure MyProc

    As

    BEGIN

    begin transaction

    update1

    if @@error != 0 GOTO Bailout

    update2

    if @@error != 0...

  • RE: stored proc

    it depends on the scope;

    outside of a stored procedure, if you issue that command, it is for the life of the session/window or until you set XACT_ABORT to OFF;

    if you...

  • RE: USE QCDB_160309

    it really depends...the devil is in the details.

    why are you breaking up related data into two separate servers? This looks like a red flag to me; are you archiving the...

  • RE: stored proc

    use a transaction like his:

    SET XACT_ABORT ON --any error, rollback any trnasactions

    BEGIN TRAN

    --do first update

    --second update

    ....

    --last update

    COMMIT TRAN --if there was any error, everything rollsback, no error checking needed

  • RE: USE DATABSE NAME

    duplicate post.

    no need to cross post to multiple forums it fractures the answers you get and makes posters duplicate others work.

    the "Recent Posts" link shows us everything.

    continue the thread...

  • RE: Please help me in Qurey

    syntax wise, your query is fine; you didn't say what the issue is you need help explaining.

    can you tell us what is wrong? does the query fail? do you need...

  • RE: USE QCDB_160309

    In order to "Use" a server, a connection has to already be established...SSMS does not have any commands that you can use in TSQL to change or modify your connection...so...

  • RE: "NOT IN" phrase in WHERE clause doesn't work

    yeah when your nose is lost in the details,things like that still ding me once in a while, even after I've worked around it a zillion times.

  • RE: "NOT IN" phrase in WHERE clause doesn't work

    if you use NOT IN, you must exclude the NULLs; anything IN = or LIKE NULL is undefined:

    SELECT * FROM BIG_THINGS

    WHERE THING_ID NOT IN

    (SELECT THING_ID FROM THINGS WHERE THING_ID...

  • RE: t-sql help

    aw comeon Mh;

    with 170+posts, I KNOW you know better.

    Always post a table structure and insert statements so people can help you.

    here's a fake table and data for others to try...

  • RE: Who CREATED and/or ALTERED an object

    Casper (3/30/2009)


    yeah i thought auditing would have to be the way out.

    Just by the way - you said "if not too much time has passed" i can use the default...

  • RE: Who CREATED and/or ALTERED an object

    if not too much time has passed, the default trace can help:

    -- obtain file name for Default Trace

    declare @TraceFileName nvarchar(256)

    set @TraceFileName = (select path from sys.traces where is_default =...

  • RE: Have no access and unable to administer

    Krishna was alluding to the "sa" username and password on the SQL server for sysadmin rights. since it looks like someone removed access for BUILTIN\Administrators, where all the local and...

  • RE: sql server 2000

    yes...you can take a SQL 7 or 2000 backup and restore it on a SQL2005 server; the restore automatically upgrades it to the newer format; you just cannot do the...

  • RE: unidentified SEVERE performance issue

    here's an article i saved on parameter sniffing; basically, the default for an execution plan is to look at the statistics to determine how unique the parameter is; but when...

Viewing 15 posts - 11,341 through 11,355 (of 13,469 total)