Its very simple actually - Here is the procedure
Table considered for this example
CREATE TABLE [User] ([User_ID] INT,[Group_ID] INT,[User_Session_ID] INT,[Created_Date] datetime,[User_Expired] bit)
Insert some data so that we can test the proc
insert into [User]
select 1,1,1,Dateadd(dd,-6,GetDate()),0
UNION
select 2,2,2,Dateadd(dd,-8,GetDate()),0
Here is the procedure which updates the user profiles by marking them as expired and returns the updated user ids
CREATE PROCEDURE GetAllUserswhosProfilesExpired
AS
BEGIN
UPDATE [User] SET [User_Expired]=1 WHERE Created_Date>=Dateadd(dd,-7,GetDate())
SELECT * FROM [User] WHERE Created_Date>=Dateadd(dd,-7,GetDate())
END
Try executing the proc
EXEC GetAllUserswhosProfilesExpired