Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
T-SQL (SS2K8)
»
SQL Express - Create maintenance plan to run...
16 posts, Page 1 of 2
1
2
»»
SQL Express - Create maintenance plan to run truncate table
Rate Topic
Display Mode
Topic Options
Author
Message
lsalih
lsalih
Posted Wednesday, November 07, 2012 7:27 AM
SSC Rookie
Group: General Forum Members
Last Login: Today @ 7:04 AM
Points: 44,
Visits: 192
Hi -
I am new to SQL express, can someone please guide me to how I can schedule a task to run truncate table command since there is no maintenace plan available with this version of SQL. Thanks.
Post #1381974
anthony.green
anthony.green
Posted Wednesday, November 07, 2012 7:30 AM
SSCertifiable
Group: General Forum Members
Last Login: Friday, April 12, 2013 3:51 AM
Points: 5,075,
Visits: 4,831
Setup a windows scheduled task which executes a batch file that contains the nessesary SQLCMD switches and pass in the command in a SQL file via the -i switch.
http://msdn.microsoft.com/en-us/library/ms162773.aspx
Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1
&
Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger
Post #1381978
lsalih
lsalih
Posted Wednesday, November 07, 2012 7:36 AM
SSC Rookie
Group: General Forum Members
Last Login: Today @ 7:04 AM
Points: 44,
Visits: 192
Thank you. I will give it a shot hopfully it works.
Post #1381982
lsalih
lsalih
Posted Wednesday, November 07, 2012 8:02 AM
SSC Rookie
Group: General Forum Members
Last Login: Today @ 7:04 AM
Points: 44,
Visits: 192
The named pipe for that instance I want to schedule the truncate table task in disabled, I get an error when trying to use sqlcmd. Any other way, please?
Post #1381999
anthony.green
anthony.green
Posted Wednesday, November 07, 2012 8:15 AM
SSCertifiable
Group: General Forum Members
Last Login: Friday, April 12, 2013 3:51 AM
Points: 5,075,
Visits: 4,831
what error do you get?
Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1
&
Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger
Post #1382011
lsalih
lsalih
Posted Wednesday, November 07, 2012 8:20 AM
SSC Rookie
Group: General Forum Members
Last Login: Today @ 7:04 AM
Points: 44,
Visits: 192
Named Pipes Provider: Could not open a connection to SQL Server [2].
Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establi
shing a connection to the server. When connecting to SQL Server 2005, this failu
re may be caused by the fact that under the default settings SQL Server does not
allow remote connections..
Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.
Post #1382015
anthony.green
anthony.green
Posted Wednesday, November 07, 2012 8:24 AM
SSCertifiable
Group: General Forum Members
Last Login: Friday, April 12, 2013 3:51 AM
Points: 5,075,
Visits: 4,831
Now we fall into the troubleshooting steps of why it cannot connect.
Server up and running?
Correct server name listed in the -S switch?
Can connect via SSMS to the server?
Server set to allow remote connections?
As its SQL Express, you will more than likely have a named instance so you will need to ensure that the -S switch is correctly set -S computername\SQLExpress
Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1
&
Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger
Post #1382017
lsalih
lsalih
Posted Wednesday, November 07, 2012 8:40 AM
SSC Rookie
Group: General Forum Members
Last Login: Today @ 7:04 AM
Points: 44,
Visits: 192
I do have a named instance, and i did use the correct name. What I saw is that named pipe for that instance is disabled. I can connect to the named instance using management studio without a problem.
Post #1382023
anthony.green
anthony.green
Posted Wednesday, November 07, 2012 8:44 AM
SSCertifiable
Group: General Forum Members
Last Login: Friday, April 12, 2013 3:51 AM
Points: 5,075,
Visits: 4,831
Try disabling the named pipes client protocol, it should be the last one it falls back on anyway, typical config is that it goes shared memory, tcp/ip, named pipes.
Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1
&
Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger
Post #1382027
lsalih
lsalih
Posted Wednesday, November 07, 2012 8:54 AM
SSC Rookie
Group: General Forum Members
Last Login: Today @ 7:04 AM
Points: 44,
Visits: 192
Below is what I got. How about using stored procedure? All I need is to have a job truncate two tables from two different databases to get truncated on weekly bases.
HResult 0x274D, Level 16, State 1
TCP Provider: No connection could be made because the target machine actively re
fused it.
Sqlcmd: Error: Microsoft SQL Native Client : An error has occurred while establi
shing a connection to the server. When connecting to SQL Server 2005, this failu
re may be caused by the fact that under the default settings SQL Server does not
allow remote connections..
Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.
Post #1382032
« Prev Topic
|
Next Topic »
16 posts, Page 1 of 2
1
2
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.