Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Left outer join

$
0
0
Hi AllWe have upgraded our MS SQL server from 2008 to 2014 and one of the SP isn't working. Our SQL guy has left and I'm trying to work out the issue. The SP seems to using an old method for Left Outer Join, (=*) and i'm trying to rewrite it, however unsuccesfully.Hoping someone can help me, I have included the snippet of the code------------------------------------------INSERT #operator_new (operatorCode, storeId, personId, storeCode, password, name, mnemonic, accessGroup, active, loggedOn, language, country, dialect, changePassword, isInShift) SELECT person.logon AS operatorCode, @storeId as storeId, person.Id as personId, busidentity.description2 as storeCode, person.password, person.familyName AS name, person.firstName AS mnemonic, person.accessGroup, 1 as active, 0 as loggedOn, -- this will be replaced with the old value person.languageCode AS language, person.countryCode AS country, NULL AS dialect, person.changePassword, isInShift = CASE WHEN timePeriod.actualEndTime IS NULL AND timePeriod.actualStartTime IS NOT NULL THEN 1 ELSE 0 END FROM person, busIdentity, accessGroup, accessGroupProperty, timePeriod WHERE person.accessGroup = accessGroup.id AND accessGroup.id = accessGroupProperty.accessGroupID AND accessGroupProperty.accessPropertyId = 1 -- access property is AccessLevel AND accessGroupProperty.content = 9 -- AccessLevel is Administrator AND Person.status = 0 -- person is active AND busIdentity.id = (Select bus.id from BusIdentity bus, Context ctx Where ctx.currentValue = bus.description2 AND ctx.subject = 'HeadOffice' AND ctx.parameter = 'Store') AND person.logon not in (select operatorCode from #Operator_new) AND timePeriod.busIdentityId = @storeId AND timePeriod.personId =* person.id AND timePeriod.actualEndTime IS NULL------------------------------------------Thank you all very much for help.Cheers, Jason

Viewing all articles
Browse latest Browse all 3145

Trending Articles