I have an asp repeater reading a datasource and it's linked eventually to this code through the code behind
[dbo].[GetFeatStatic]
AS
BEGIN
DECLARE @FeaturedStatic TABLE (
UserID INT,
UserTitle varchar(50),
Title varchar(50),
Summary text,
DatePosted date,
FirstName varchar(50),
LastName varchar(50),
Picture varchar(100)
)
INSERT INTO @FeaturedStatic
SELECT TOP 6 StaticContent.UserID, StaticContent.UserTitle, StaticContent.Title, SUBSTRING(StaticContent.Article, 0, 200) AS Summary, StaticContent.DatePosted, 'FirstName', 'LastName', 'Picture'
FROM StaticContent
INNER JOIN FeaturedStatic ON FeaturedStatic.ContentID = StaticContent.ContentID
ORDER BY FeaturedStatic.DateFeatured DESC
UPDATE @FeaturedStatic
SET
FirstName = Users.FirstName,
LastName = Users.LastName,
Picture = Users.Picture
FROM Users
INNER JOIN FeaturedStatic ON UserID = Users.UserID
SELECT * FROM @FeaturedStatic
END
Wondering why it won't read Users.Picture + Users.First/LastName. I think it has something to do with INNER JOIN FeaturedStatic ON UserID = Users.UserID, but not sure.
Thanks in advance.