Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Results of an UPDATE SP to a text file

Status
Not open for further replies.

runnerlk

MIS
Jul 19, 2002
41
0
0
US
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.
 
Look up bcp. I have done this but cannot remember everything and have to look it up every time. The problem I find is that column headers are not included in the output.

Good luck,
djj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top