Hi
I need this statement to print to the same log.txt when running xp_cmdshell
PRINT 'Upgrading.... ' + @.DataBaseName
How do I fit it into this command?
set @.command = 'osql -Usa -Padmin -S jaco_ -d ' + @.DataBaseName + ' -i
c:\temp\Complete(7-9).sql' + ' -n ' + ' >> c:\temp\log.txt'
exec master..xp_cmdshell @.command
Thanks
JacoHi
Use
PRINT 'Upgrading.... ' + DB_NAME()
instead.
John
"Jaco" wrote:
> Hi
> I need this statement to print to the same log.txt when running xp_cmdshel
l
> PRINT 'Upgrading.... ' + @.DataBaseName
> How do I fit it into this command?
> set @.command = 'osql -Usa -Padmin -S jaco_ -d ' + @.DataBaseName + ' -i
> c:\temp\Complete(7-9).sql' + ' -n ' + ' >> c:\temp\log.txt'
> exec master..xp_cmdshell @.command
> Thanks
> Jaco
>|||On Tue, 20 Sep 2005 03:16:05 -0700, Jaco wrote:
>Hi
>I need this statement to print to the same log.txt when running xp_cmdshell
>PRINT 'Upgrading.... ' + @.DataBaseName
>How do I fit it into this command?
>set @.command = 'osql -Usa -Padmin -S jaco_ -d ' + @.DataBaseName + ' -i
>c:\temp\Complete(7-9).sql' + ' -n ' + ' >> c:\temp\log.txt'
>exec master..xp_cmdshell @.command
>Thanks
>Jaco
Hi Jaco,
If you can change the contents of c:\temp\Complete(7-9).sql, then add
this command at the beginning:
PRINT 'Upgrading.... ' + DB_NAME()
If you can't change c:\temp\Complete(7-9).sql, then use this:
set @.command = 'echo Upgrading.... ' + @.DataBaseName
+ ' >> c:\temp\log.txt'
exec master..xp_cmdshell @.command
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)sql
Showing posts with label txt. Show all posts
Showing posts with label txt. Show all posts
Monday, March 26, 2012
Saturday, February 25, 2012
q; delete files
I need to delete all the *.txt file in a specific folder modified date is
older than 2 months,. How can I do this in a stored procedure?JIM.H. wrote:
> I need to delete all the *.txt file in a specific folder modified date is
> older than 2 months,. How can I do this in a stored procedure?
http://realsqlguy.com/serendipity/a...th-The-Old.html
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||If you are capable of SQL Server 2005 you would do that the best with a
CLR procedure. Looping though the files collections and delewting the
appropiate files.
HTH, Jens Suessmyer.
http://www.sqlserver2005.de
--
older than 2 months,. How can I do this in a stored procedure?JIM.H. wrote:
> I need to delete all the *.txt file in a specific folder modified date is
> older than 2 months,. How can I do this in a stored procedure?
http://realsqlguy.com/serendipity/a...th-The-Old.html
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||If you are capable of SQL Server 2005 you would do that the best with a
CLR procedure. Looping though the files collections and delewting the
appropiate files.
HTH, Jens Suessmyer.
http://www.sqlserver2005.de
--
q; delete files
I need to delete all the *.txt file in a specific folder modified date is
older than 2 months,. How can I do this in a stored procedure?JIM.H. wrote:
> I need to delete all the *.txt file in a specific folder modified date is
> older than 2 months,. How can I do this in a stored procedure?
http://realsqlguy.com/serendipity/archives/9-Out-With-The-Old.html
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||If you are capable of SQL Server 2005 you would do that the best with a
CLR procedure. Looping though the files collections and delewting the
appropiate files.
HTH, Jens Suessmyer.
--
http://www.sqlserver2005.de
--
older than 2 months,. How can I do this in a stored procedure?JIM.H. wrote:
> I need to delete all the *.txt file in a specific folder modified date is
> older than 2 months,. How can I do this in a stored procedure?
http://realsqlguy.com/serendipity/archives/9-Out-With-The-Old.html
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||If you are capable of SQL Server 2005 you would do that the best with a
CLR procedure. Looping though the files collections and delewting the
appropiate files.
HTH, Jens Suessmyer.
--
http://www.sqlserver2005.de
--
Subscribe to:
Posts (Atom)