I have created a scheduled job in the enterprise manager, which checks around 20 different date columns and replaces any non-dates with NULL using the following syntax: -
update policy set [exp] =null where isdate (substring([exp],4,2)+'-'+left([exp],2)+'-'+'200'+right ([exp],1 ))=0
go
update policy set [eff] =null where isdate (substring([eff],4,2)+'-'+left([eff],2)+'-'+'200'+right ([eff],1 ))=0
go
update policy set [written] =null where isdate (substring([written],4,2)+'-'+left([written],2)+'-'+'200'+right ([written],1 ))=0
go
go
update policy set [eff] =null where isdate (substring([eff],4,2)+'-'+left([eff],2)+'-'+'200'+right ([eff],1 ))=0
go
update policy set [written] =null where isdate (substring([written],4,2)+'-'+left([written],2)+'-'+'200'+right ([written],1 ))=0
go
etc......
When I start the job, if fails within 2 seconds. If I copy the syntax in to the query analyzer it works fine.
All help appreciated.

Scheduled Job Not Working
Razek
A couple of questions
1 what is the error
2 who is the owner of the Job (and does he have permissions to the DB)
3 is the correct DB seleted in the step
Denis the SQL Menace
http://sqlservercode.blogspot.com/
BBesser
mohammed barqawi
to view the errro message , right click on the job, select view job history, click show step details (top right)
Click on the stepid and the error will be displayed in the bottom part
Denis the SQL Menace
http://sqlservercode.blogspot.com/
madzip
Convert to varchar first, take a look at this
select substring(1952005,1,2) -- will fail
select substring(convert(varchar(8),1952005),1,2) -- correct
Denis the SQL Menace
http://sqlservercode.blogspot.com/John Holliday
david_dev
go