November 29, 2012 at 8:24 am
When I run this query I got an error 'Invalid column name 'Gender' '
SELECT ROW_NUMBER() OVER( ORDER BY gender) ROWID,
Gender = P.Fsex,
MartialTypeID = P.Frelation,
Lastvisit = P.Flastvisit,
NxtVisit = P.Fnextvisit,
LastTxNumber = P.Flasttxno,
OldAcct = P.fOldAcct,
ClaimGroup = P.fClaimGroup,
ConsultDate = P.fConsultDate,
usedby=P.Fusedby,
IsDeleted = P.Fdelete,
CreatedDate = P.Fwhen,
TrojanId = P.fTrojanId,
PreferMtd =P .fPreferMtd,
AllowText = P.fAllowText,
KodakID = P.fKodak,
TempHold = P.fTempHold,
TempBy = P.fTempBy,
TempWhen = P.fTempWhen,
TOD = P.fTOD
into #temp
From WCDentalSQL_VAL..Patient P
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
November 29, 2012 at 8:27 am
Because it's not yet exist to be used in OVER (ORDER BY ...)
Change it to:
.. ROW_NUMBER() OVER( ORDER BY P.Fsex) ROWID,
...
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply