Sunday, March 25, 2012

@@error

Got a tiny issue that needs help. I have this little
statement:
IF (SELECT CLSRECORD_ACCESSEDID FROM CLSRECORD_ACCESSED = CLSSTATUS.CONTACTID)
Basically what we want to do is to ensure that if the
result from CLSRECORD_ACCESSEDID equals what’s found in
the CLSSTATUS.CONTACTID, to do a rollback transaction.
Probably should be prefaced with an @.@.error...
Just need the correct, clean syntax on the above.DDL would help. It is not clear what tables are involved and what columns
are used. A potential statement is:
if exists (select * from my_table where mycolumn = 'what’s')
... logic for finding
else
... logic for not finding
"Wheel" <neal.pawlowski@.loanpro.com> wrote in message
news:0fa201c38d9e$d7aa5780$a101280a@.phx.gbl...
> Got a tiny issue that needs help. I have this little
> statement:
> IF (SELECT CLSRECORD_ACCESSEDID FROM CLSRECORD_ACCESSED => CLSSTATUS.CONTACTID)
> Basically what we want to do is to ensure that if the
> result from CLSRECORD_ACCESSEDID equals what’s found in
> the CLSSTATUS.CONTACTID, to do a rollback transaction.
> Probably should be prefaced with an @.@.error...
> Just need the correct, clean syntax on the above.
>|||Do you mean:
IF EXISTS(SELECT NULL FROM CLSRECORD_ACCESSED WHERE CLSRECORD_ACCESSEDID =CLSSTATUS.CONTACTID)
?
--
Jacco Schalkwijk
SQL Server MVP
"Wheel" <neal.pawlowski@.loanpro.com> wrote in message
news:0fa201c38d9e$d7aa5780$a101280a@.phx.gbl...
> Got a tiny issue that needs help. I have this little
> statement:
> IF (SELECT CLSRECORD_ACCESSEDID FROM CLSRECORD_ACCESSED => CLSSTATUS.CONTACTID)
> Basically what we want to do is to ensure that if the
> result from CLSRECORD_ACCESSEDID equals what’s found in
> the CLSSTATUS.CONTACTID, to do a rollback transaction.
> Probably should be prefaced with an @.@.error...
> Just need the correct, clean syntax on the above.
>

No comments:

Post a Comment