Writing sql jobs

  • I need to write a sql job that basically runs an update query to update a column to remove spaces from a column of a table

    Update tbl set col1=replace(col1,' ','')

    I know nothing about writing sql jobs so can some one help me with the following please

    1. How to write a job to do this update

    2. How can I create an audit log within the job to see how many rows have been updated each time the job runs

    3. how to send an update report at an email id to show which columns have been updated

    Pls help. Thanks

  • 1. In SQL Server Management Studio, right-clilck on SQL Server Agent, select new, select job. One

    the General page, give the job a name. On the Steps page, click the New button, put the

    update statement in the Command space and make the Type T-SQL.

    2. On the Advanced page of the New Job Step, you can specify an output file for the results of the

    query, log it to a table, or include the output i.e. row count in the job history.

    3. Create another step that sends an email.

    You can find information about this, with examples, in BooksOnLine.

    Greg

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply