Dear All,
Periodically, i need to copy a file from the source folder to destination
folder. the source file will be updated from time to time. Before copying
the file to destination folder, i need to compare the modified date of the
file, mean only copy the file to destination folder if the source file is
updated. How can we do this in SQL?
I will use the xp_cmdShell to copy the file. If use the xp_getfiledetails,
how can i get the information return fromt the stored procedure to check the
modified date? Or, is there any better method of doing this?
I am using SQL Server 2000.
Thanks & Best Regards,
EdwardInsert as below..and then you can compare ..
CREATE TABLE #FILE
(
name varchar(30) null,
size int null,
creationdate int null,
creationtime int null,
lastwrittendate int null,
lastwrittentime int null,
lastaccesseddate int null,
lastaccessedtime int null,
attributes int null
)
INSERT #FILE EXEC master..xp_getfiledetails @.FILE_NAME
MJKulangara
http://sqladventures.blogspot.com|||Hi
You could do the file copy and comparison using a DTS package and an ActiveX
script. See
http://www.sqldts.com/default.aspx?292
John
"Edward Low" <wc_low@.hotmail.com> wrote in message
news:eRZ8g9qLGHA.3936@.TK2MSFTNGP12.phx.gbl...
> Dear All,
> Periodically, i need to copy a file from the source folder to destination
> folder. the source file will be updated from time to time. Before copying
> the file to destination folder, i need to compare the modified date of the
> file, mean only copy the file to destination folder if the source file is
> updated. How can we do this in SQL?
> I will use the xp_cmdShell to copy the file. If use the xp_getfiledetails,
> how can i get the information return fromt the stored procedure to check
> the modified date? Or, is there any better method of doing this?
> I am using SQL Server 2000.
> Thanks & Best Regards,
>
> Edward
>
Showing posts with label folder. Show all posts
Showing posts with label folder. Show all posts
Tuesday, March 20, 2012
Sunday, February 12, 2012
Command line to pass parameters in SQL
Hi,
Do you know if any command I can use to pass parameters into reports,
generate PDF report format and drop it into a shared folder? Thanks.
ChuckYou can pass parameters ,and create PDF from a URL report request, but I do
not think you can specify a save directory
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Chuck" <Chuck@.discussions.microsoft.com> wrote in message
news:297FC292-95E4-408D-9E93-78C698A98AFC@.microsoft.com...
> Hi,
> Do you know if any command I can use to pass parameters into reports,
> generate PDF report format and drop it into a shared folder? Thanks.
>
> Chuck
Do you know if any command I can use to pass parameters into reports,
generate PDF report format and drop it into a shared folder? Thanks.
ChuckYou can pass parameters ,and create PDF from a URL report request, but I do
not think you can specify a save directory
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Chuck" <Chuck@.discussions.microsoft.com> wrote in message
news:297FC292-95E4-408D-9E93-78C698A98AFC@.microsoft.com...
> Hi,
> Do you know if any command I can use to pass parameters into reports,
> generate PDF report format and drop it into a shared folder? Thanks.
>
> Chuck
Subscribe to:
Posts (Atom)