Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 If exist

Author  Topic 

Trudye
Posting Yak Master

169 Posts

Posted - 2009-01-12 : 10:29:44
Hi Guys, Happy New Year I haven't bugged you for a while. But now I have a question:
I am getting a Syntax error on the following statement

if exist E:\data\Lost\Archive\Lost_Stolen_%timestr%.txt
del E:\data\Lost\Input\*.txt

I tried the following too but that didn't work either:

if exist E:\data\Lost\Archive\Lost_Stolen_%timestr%.txt
(del E:\data\Lost\Input\*.txt)
Any suggestions

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-12 : 10:34:17
is this vbscript?
Go to Top of Page

Trudye
Posting Yak Master

169 Posts

Posted - 2009-01-12 : 14:26:09
I'm sorry wrong forum this is batch (.bat)
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-01-12 : 14:39:07
Maybe your variable %timestr% is not set correctly.

Try a DIR E:\data\Lost\Archive\Lost_Stolen_%timestr%.txt to see...


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -