I have the following simple SP running on an SQL 2005 Standard edition server.:
CREATE proCEDURE dbo.sp_UPDATE_CLE_RECORDS
AS
UPDATE c
SET Last_Name = m.MLNAME,
First_Name = m.MFNAME,
Middle_Name = m.MMNAME,
Prefix = m.MPREFIX,
Suffix = m.MSUFFIX
FROM cle c, MEMBER M
WHERE C.MID = m.MID
AND datediff(day,c.Date_Indexed,getdate())<'10'
I would like to write a .csv file to a share for use in Crystal Reports or Excel when the: "SET Last_Name = m.MLNAME" fails. I was thinking about using OUTPUT but not sure of the syntax.
Any help would be greatly appreciated.
CREATE proCEDURE dbo.sp_UPDATE_CLE_RECORDS
AS
UPDATE c
SET Last_Name = m.MLNAME,
First_Name = m.MFNAME,
Middle_Name = m.MMNAME,
Prefix = m.MPREFIX,
Suffix = m.MSUFFIX
FROM cle c, MEMBER M
WHERE C.MID = m.MID
AND datediff(day,c.Date_Indexed,getdate())<'10'
I would like to write a .csv file to a share for use in Crystal Reports or Excel when the: "SET Last_Name = m.MLNAME" fails. I was thinking about using OUTPUT but not sure of the syntax.
Any help would be greatly appreciated.