Solved

SQL Server Where Condition

Posted on 2014-11-11
5
100 Views
Last Modified: 2014-11-11
Hi experts,

I have is:
Auto complete all records where GRP_NR IN (470014, 470025, 470038, 470050, 470062, 470075, 470086, 470098, 470110, 470122).

set CAQH_MAIN field values =
STAT_CD = 'COMPLETED'
STAT_TS = file load date timestamp
CAQH_USR_KY = NULL
VALDTN_STAT = 'D'
VALDTN_RSN = 'NONG'
VALDTN_ADDL_OI_NM = 'IND INDEMNITY'


The table name:
CAQH_MAIN

Need some help with the correct syntax and direction?

Thank You for helping me...
0
Comment
Question by:Amour22015
  • 2
  • 2
5 Comments
 
LVL 13

Accepted Solution

by:
Koen Van Wielink earned 500 total points
ID: 40435742
update CAQH_MAIN
set
STAT_CD = 'COMPLETED',
STAT_TS = Getdate(),
CAQH_USR_KY = NULL,
VALDTN_STAT = 'D',
VALDTN_RSN = 'NONG',
VALDTN_ADDL_OI_NM = 'IND INDEMNITY'
Where GRP_NR IN (470014, 470025, 470038, 470050, 470062, 470075, 470086, 470098, 470110, 470122)

Open in new window

0
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 40435749
UPDATE CAQH_MAIN
set STAT_CD = 'COMPLETED',
 STAT_TS = file load date timestamp,  --You may have to look at the syntax of this one
 CAQH_USR_KY = NULL,
 VALDTN_STAT = 'D',
 VALDTN_RSN = 'NONG',
 VALDTN_ADDL_OI_NM = 'IND INDEMNITY'
WHERE GRP_NR IN (470014, 470025, 470038, 470050, 470062, 470075, 470086, 470098, 470110, 470122)
GO


Kelvin
0
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 40435750
Beaten to it!
0
 

Author Closing Comment

by:Amour22015
ID: 40435775
You were the first, great thanks
0
 
LVL 13

Expert Comment

by:Koen Van Wielink
ID: 40436533
Haha, sorry Kelvin. I'm glad I'm finally first for a change, usually get beaten myself by PortletPaul :p.
Glad I could help.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Encrypting SQL Server 2014 or SQL Server 2016 4 29
SSIS On fail action 5 37
Error when creating an UPDATE Trigger in SQL 6 18
sql 2016 data tools breakdown.. 1 11
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question