I have a csv file that I am importing into an existing db. Contained within
the data are 6 fields, imageurl1 - imageurl6. I need to insert the data into
my dabase and store the number of images associated with the record. Right
now I have the below but am getting errors:
DECLARE @numPhotos int
SET @numPhotos = 0
SELECT ID,
IF ImageURL6 IS NOT NULL
BEGIN
SET @numPhotos = 6
END
IF ImageURL5 IS NOT NULL
BEGIN
SET @numPhotos = 5
END
...
ELSE
BEGIN
SET @numPhotos = 0
END
FROM cdmdatafeed
Any idea how I can return the correct number of images?
TIA,
Duane
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- One more dumb question Eric Creese
- Re: One more dumb question Bryan Stevenson
- Re: Help with A Query Duane Boudreau
- Re: Help with A Query Jochem van Dieten
- Re: Help with A Query Jochem van Dieten
- RE: Help with A Query Duane Boudreau
- Re: One more dumb question Bryan Stevenson
- Re: One more dumb question Austin Govella
- RE: One more dumb question Eric Creese
- RE: One more dumb question Eric Creese
- RE: One more dumb question Eric Creese