SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to Schedule a Job in SQL Server Database Creation Script


How to Schedule a Job in SQL Server Database Creation Script

Author
Message
gyani
gyani
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 7
I want to create a Job scheduler in SQL Server 2008 that should be create a log in text file and stored in some other drive automatically. So for that I think I must need some script. So may be you can give me the right suggestion to resolve my issue.

Thanks.Discuss
LutzM
LutzM
SSC-Insane
SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)SSC-Insane (23K reputation)

Group: General Forum Members
Points: 23715 Visits: 13559
You could use a WINDOWS scheduled task calling a bcp out command with a trusted connection.
Regarding details for bcp please see BOL (BooksOnLine, the SQL Server help syste usually installed together with SQL Server).
Another option would be using a SQL Server job and xp_cmdshell but that should require additiona lsteps to avoid making xp_cmdshell available for every user (which would open a security hole of unknown depth).
A third solution would be a SSIS package called.

I, personally, would use either the first or the second option.



Lutz
A pessimist is an optimist with experience.

How to get fast answers to your question
How to post performance related questions
Links for Tally Table , Cross Tabs and Dynamic Cross Tabs , Delimited Split Function
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search