×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Executing more sql commands

Executing more sql commands

Executing more sql commands

(OP)
I want to execute several sql commands after each other.

CODE

UPDATE CLIENTS SET CLIENTS.XDEPTID = 1085, CLIENTS.XDEPTNR = 88513, CLIENTS.POB = 921
WHERE (((CLIENTS.XDEPTID)=921) AND ((CLIENTS.XDEL) Is Null Or (CLIENTS.XDEL)='N'));
UPDATE CLIENTS SET CLIENTS.XDEPTID = 1086, CLIENTS.XDEPTNR = 88520, CLIENTS.POB = 894
WHERE (((CLIENTS.XDEPTID)=894) AND ((CLIENTS.XDEL) Is Null Or (CLIENTS.XDEL)='N'));

but executing this part I get an error:
[Microsoft][ODBC SQL Server Driver]Function sequence error"

I don't know much about sql but can somebody help me with this problem ?

RE: Executing more sql commands

Maybe the removal of a few brackets might help ? Not 100% sure - because I don't know what client is being used to execute the code; this solution has not been tested.

UPDATE CLIENTS SET CLIENTS.XDEPTID = 1085, CLIENTS.XDEPTNR = 88513, CLIENTS.POB = 921 WHERE (CLIENTS.XDEPTID=921 AND (CLIENTS.XDEL Is Null Or CLIENTS.XDEL='N'));
UPDATE CLIENTS SET CLIENTS.XDEPTID = 1086, CLIENTS.XDEPTNR = 88520, CLIENTS.POB = 894
WHERE (CLIENTS.XDEPTID=894 AND (CLIENTS.XDEL Is Null Or CLIENTS.XDEL='N'));

Note that this...

(CLIENTS.XDEL Is Null Or CLIENTS.XDEL='N')

...can be reduced to...

ISNULL(CLIENTS.XDEL,'N')='N'

best wishes

RE: Executing more sql commands

Oops, sorry, forgot which forum I was in!

Replace 'ISNULL' with 'COALESCE' in the previous post

RE: Executing more sql commands

Please ignore my previous two posts, it's not an SQL problem and I shouldn't have treated it as such.

This question needs to be posed in some other forum, depending upon what client you are using to issue these statements against SQL Server. Once again my apologies for wasting your time.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close