Using SQL Express 2005
I have a table (tblDefaultPic) that contains one record, it is priming table, the data in it is used to create a default record in another table (tblPics) when a new user is created.
The key field in all tables is UserID which is a UniqueIdentifier.
The field UserID definately exists in table (aspnet_users)
Can't quite seem to get my head around this, maybe its getting late, looking for a quick answer if possible, thanks.
This is what I have, but the select returns 0 records, hmmm.
INSERT INTO tblPics ([Filename], FileExtension, Picture, [Size], [Type], Created, Thumb, Album, Active, PrimaryPic, UserID)
SELECT D.[Filename], D.FileExtension, D.Picture, D.[Size], D.[Type], D.Created, D.Thumb, D.Album, D.Active, D.PrimaryPic, @UserID
FROM tblDefaultPic AS D Left OUTER JOIN
aspnet_Users AS U ON D.UserID = U.UserId LEFT OUTER JOIN
tblPics as Px ON D.UserID = Px.UserID
WHERE (Px.UserID IS NULL)AND
(D.UserID IS NULL)