Viewing 15 posts - 11,341 through 11,355 (of 13,469 total)
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...
April 1, 2009 at 6:34 am
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...
April 1, 2009 at 6:19 am
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...
April 1, 2009 at 6:15 am
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
April 1, 2009 at 5:09 am
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...
April 1, 2009 at 5:06 am
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...
April 1, 2009 at 5:01 am
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...
April 1, 2009 at 4:58 am
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.
March 31, 2009 at 3:48 pm
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...
March 31, 2009 at 3:33 pm
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...
March 30, 2009 at 4:32 pm
Casper (3/30/2009)
Just by the way - you said "if not too much time has passed" i can use the default...
March 30, 2009 at 8:22 am
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 =...
March 30, 2009 at 8:07 am
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...
March 29, 2009 at 11:11 am
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...
March 27, 2009 at 10:37 pm
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...
March 27, 2009 at 8:20 am
Viewing 15 posts - 11,341 through 11,355 (of 13,469 total)