I am using this procedure to create a GUID number when reading a table.
The stored procedure works correctly, but displays only two column, id and EventId.
I need to display all the other columns of dbo.ASFC_App_Timetable beyond id and EventId.
Other columns are EventTitle and EventNote for example.
Are you able to provide me a sample of code for solving this issue?
CREATE PROCEDURE SPROCGetAllEventsForStudent
AS
BEGIN
SELECT convert(uniqueidentifier,
stuff('62799568-6EF2-4C95-84E7-4953A6959C99',1,len(rn),convert(varchar,rn))) id,
T.EventId
FROM (
select x.EventId, ROW_NUMBER() over (order by x.EventId) rn
FROM dbo.ASFC_App_Timetable as x ) T
END
At the moment is displays.. I need to display the other columns, too:
22799568-6EF2-4C95-84E7-4953A6959C99 AB-TT-E1-2/TU12
32799568-6EF2-4C95-84E7-4953A6959C99 PU-A2-2 -Z/CL12
42799568-6EF2-4C95-84E7-4953A6959C99 PU-A2-2 -Z/CL12
52799568-6EF2-4C95-84E7-4953A6959C99 PU-A2-2 -Z/CL12
62799568-6EF2-4C95-84E7-4953A6959C99 PU-A2-2 -Z/CL12
72799568-6EF2-4C95-84E7-4953A6959C99 PU-A2-2 -Z/CL12
82799568-6EF2-4C95-84E7-4953A6959C99 PU-A2-2 -Z/CL12
why can’t you add the other columns in the subquery?