May 20, 2008 at 11:31 am
Methinks you're going too complex
CREATE TABLE #tempFileName (
FileNumber INT IDENTITY,
FileName varchar(50)
)
INSERT INTO #TempFileName (FileName)
SELECT DISTINCT Filename FROM #Temp
UPDATE #Temp
SET FileNumber = #tempFileName.FileNumber
FROM #tempFileName WHERE #tempFileName.FileName = #Temp.FileName
Yes? No? Almost, but not quite?
The more info you can provide on a problem, the faster and better the help you will get. It may seem obvious to you, but we're not there, we don't know the background or the details.
Did you come right with your first problem? If not, please post the code you have, some sample data and what you want, and I'll see if I can spot the problem with it.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 26, 2008 at 3:38 am
Hi Gail
Sorry for not getting back to you. I was assigned on another urgent task, and today I am supposed to be back on these script, and will try your script.
Thanks again for all your help!
Johann
Viewing 2 posts - 46 through 46 (of 46 total)
You must be logged in to reply to this topic. Login to reply