or you could open your Access Data Project.. and TOOLS, Analyze with
Excel and presto, chango-- any data you've got in SQL, including views,
sprocs, forms, reports-- you can export to Excel
-Aaron
[quoted text, click to view] pichula wrote:
> Thanks Ian, I'll try it.
>
>
> Doownai wrote:
> > depending upon your views of xp_cmdshell, you could try something like this:
> >
> > modify your stored procedure to return its data to a temporary table and
> > then use the following Stored Procedure to make a call to the bcp utility to
> > send it to a file.
> >
> > create proc [EXPORT_TABLE]
> > (@TabName as varchar(30)
> > ,@Filename varchar(100) output )
> > as
> > begin
> > set nocount on
> > declare
> > @Path varchar(2000),
> > @bcpCommand varchar(2000)
> >
> > -- set your path to stored the file
> > set @Path = 'D:\temp\'
> > set @FileName = @Filename + '.xls'
> >
> > -- export the data
> > -- you will have to make an edit or two for your environment.
> > set @bcpCommand = 'bcp [yourDBname].dbo.' + @TabName + ' out "' + @path +
> > @FileName + '" -c -T -U [username] -P [password]'
> > exec master..xp_cmdshell @bcpCommand--, no_output
> > end
> >
> > go
> >
> > [EXPORT_TABLE] <YourTabName>, <YourFileName>
> >
> >
> > Cheers,
> >
> > Ian.