Tuesday, March 20, 2012

run sql script at a specific time

I have an sql statement that I can run by hand. How do I get a job to run this automatically.
I have tried to create a job and it just failes out every time...You need to give more information. What does your job do. What job steps are executed. What error messages are generated...
Start by setting the job to log messages to a file for review.|||Sorry for the late response here is my sql statement:

use intranet;
INSERT INTO USER_INFO (fpu_id,FIRSTNAME, LASTNAME, BOXNUMBER) SELECT id,first,last,box FROM stmailbox WHERE id NOT IN (SELECT FPU_ID FROM USER_INFO);

And when I go through the DTS screens. Telling DTS to copy data from a 3 column temp database to a permanent database called USER_INFO I get a warning that says "LINE 3 incorrect syntax near ')'" This is for the create table steps....

Under the next line I get, Invalid Opject named results...

I am new to DTS,

Any help would be good|||You are still not making any sense.
In your first post you say you have a job that is failing. In your second post you are talking about a DTS package.
You list some SQL code, but not how this has anything to do with your DTS package. Your error "LINE 3 incorrect syntax near ')'" doesn't even make sense given that your code only has two lines. I don't even know whether your error is referring to your SQL statement or code within your DTS package.

No comments:

Post a Comment