|
-
Apr 5th, 2012, 12:00 PM
#1
Thread Starter
Hyperactive Member
Require someone with hawk-like observational skills.
This SQL query is throwing up an error. It is pretty obvious what I am trying to achieve. Any ideas? I'm quite new to conditional SQL queries.
SQL Code:
IF EXISTS (SELECT * FROM bank_data WHERE ContactID = '95' AND BankID = 'Test_Bank') UPDATE bank_data SET Response = 'Green,Funny,Element,False,09/07/2011,13:00,Yellow,Fish-Monkey-Chimpers,Blue,' WHERE ContactID = '95' AND BankID = 'Test_Bank' ELSE INSERT INTO bank_data (ContactID, BankID, Response) VALUES ('95','Test_Bank','Green,Funny,Element,False,09/07/2011,13:00,Yellow,Fish-Monkey-Chimpers,Blue,')
-
Apr 6th, 2012, 07:00 AM
#2
Re: Require someone with hawk-like observational skills.
Syntactically it looks fine but you really haven't provided enough information for us to look at it further. Knowing what the error is, for example, might help a bit.
The best argument against democracy is a five minute conversation with the average voter - Winston Churchill
Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd
-
Apr 6th, 2012, 12:53 PM
#3
Re: Require someone with hawk-like observational skills.
If you're using SQL Server 2008, there's a new Merge statement that you could take advantage of.
That is the very essence of human beings and our very unique capability to perform complex reasoning and actually use our perception to further our understanding of things. We like to solve problems. -Kleinma
Does your code in post #46 look like my code in #45? No, it doesn't. Therefore, wrong is how it looks. - jmcilhinney
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|