Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!
I tried a merge but it tells me I cannot do an update in a WHEN NOT MATCHED MERGE into tblPermTask as pt USING (Select pt.intQId, strSSN from tblPermTaskTemp pt INNER JOIN tblSRPQuestion q on q.intquestionId = pt.intQId Where bitFilterOnly = 1) as t on t.intQId = pt.intQuestionId and pt.strssn = t.strSSN WHEN NOT MATCHED THEN UPDATE set dtCompleted = getdate(), strClosedBy = 'SYSTEM'; This is based on the old systems when bitFilterOnly did not exist but it does not work with the bitFilter only. It updates all teh records that do not have the bitFilterOnly which I do not want it too. update tblPermTask set dtCompleted = getdate(), strClosedBy = 'SYSTEM' where dtCompleted is null and convert(varchar(10), intQuestionId) + '|' + strSSN not in (select convert(varchar(10), intQId) + '|' + strSSN from tblPermTaskTemp pt INNER JOIN tblSRPQuestion q on q.intquestionId = pt.intQId Where bitFilterOnly = 1)
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|SQL server 2012 BPA and Baseline Configuration Analyzer 2.0||16||33|
|SQL Job Hung||17||37|
|SQL Server 2008 Std. License Key owner or vendor||4||56|
|Cannot connect to SQL express 2008 R2 installed on Server 2016||5||21|