What's the correct tsql syntax [SQL2008 r2] for RESTORE VERIFYONLY ...WITH CHECKSUM ?
I successfully backed up the follow DB WITH CHECKSUM and I believe I've followed the syntax for this correctly, but I'm not having any luck. If my syntax is wrong i'll gladly accept a knock on the noggin for the correct syntax. Or maybe my syntax is OK and the books online doco is wrong?
Here's my attempt WITH CHECKSUM:
RESTORE VERIFYONLY
FROM
DISK = 'Z:\foo\bar.bak'
WITH
CHECKSUM
,STATS = 2
RESTORE VERIFYONLY FAILED -- [<--from my print stmt]
@returnCode = 0 -- value of @@ERROR
@errorNum = 3013 -- value of ERROR_NUMBER()
@errorMsg = VERIFY DATABASE is terminating abnormally. -- value of ERROR_MESSAGE()
RETURN @returnCode = 3013.
Here's the other 'without' CHECKSUM:
RESTORE VERIFYONLY
FROM
DISK = 'Z:\foo\bar.bak'
WITH
--CHECKSUM
STATS = 2
18 percent processed.
37 percent processed.
55 percent processed.
74 percent processed.
92 percent processed.
100 percent processed.
The backup set on file 1 is valid.
RESTORE VERIFYONLY SUCCESSFUL. CONTINUING DB [bar] RESTORE. -- [<--from my print stmt]
@returnCode = 0 -- related postconditions
@errorNum = 0
@errorMsg = ''
Did it do a checksum validation w/o the 'WITH CHECKSUM' supplied? Or did it do this validation w/o the checksum validation? I tend to believe the answers are no, and yes, respectively. It would be nice if someone could confirm or refute this for me too.
thx