Click here to Skip to main content
15,896,359 members
Home / Discussions / Database
   

Database

 
GeneralRe: Need to execute a very time consuming Stored procedure on a remote machine. Pin
Rocky#16-Mar-08 21:28
Rocky#16-Mar-08 21:28 
GeneralRe: Need to execute a very time consuming Stored procedure on a remote machine. Pin
Krish - KP16-Mar-08 23:06
Krish - KP16-Mar-08 23:06 
GeneralRe: Need to execute a very time consuming Stored procedure on a remote machine. Pin
Rocky#17-Mar-08 0:03
Rocky#17-Mar-08 0:03 
GeneralRe: Need to execute a very time consuming Stored procedure on a remote machine. Pin
Mark J. Miller17-Mar-08 4:43
Mark J. Miller17-Mar-08 4:43 
GeneralRe: Need to execute a very time consuming Stored procedure on a remote machine. Pin
Rocky#17-Mar-08 6:03
Rocky#17-Mar-08 6:03 
GeneralRe: Need to execute a very time consuming Stored procedure on a remote machine. Pin
Mark J. Miller17-Mar-08 6:13
Mark J. Miller17-Mar-08 6:13 
GeneralRe: Need to execute a very time consuming Stored procedure on a remote machine. Pin
Rocky#17-Mar-08 6:18
Rocky#17-Mar-08 6:18 
GeneralRe: Need to execute a very time consuming Stored procedure on a remote machine. Pin
Mark J. Miller17-Mar-08 6:34
Mark J. Miller17-Mar-08 6:34 
I'm assuming your reference to a tool you found on CP implies you can create executables on the server and run them. Knowing exactly the amount of control you have over the the remote machine would make it easier to point to a single possible solution.

Can you setup a windows task?

If so I would use the sqlcmd tool: http://msdn2.microsoft.com/en-us/library/ms165702.aspx[^]. You could then create a .bat or .cmd file and tell it to execute the stored procedure with a single line of code and reference the file from windows task scheduler and tell it when to execute. Then it will execute without requiring you to be logged into the remote server.

The command would look something like this:

<br />
sqlcmd -S (local) -d databaseName -E -Q "exec storedProcname 'value1', 2, 'value3'"<br />


And the task would run as you or a windows account with permissions to the server/database. Or if you're using SQL Authentication:

<br />
sqlcmd -S (local) -d databaseName -u username -p myp@ssw0rd -Q "exec storedProcname 'value1', 2, 'value3'"<br />


NOTE: the parameter flags are case sensitive (-Q is not the same as -q).

This would be the best solution because any other solution would probably require you to be logged into the machine somehow (terminal services, etc.). This would still work as long as you can disconnect your session w/o it logging you off the machine which would allow any processes you start to continue to run. But setting up a task would be better, especially if for tasks which need to be run more than one time.


GeneralRe: Need to execute a very time consuming Stored procedure on a remote machine. Pin
Rocky#17-Mar-08 6:46
Rocky#17-Mar-08 6:46 
GeneralRe: Need to execute a very time consuming Stored procedure on a remote machine. Pin
Mark J. Miller17-Mar-08 6:56
Mark J. Miller17-Mar-08 6:56 
GeneralRe: Need to execute a very time consuming Stored procedure on a remote machine. Pin
Rocky#17-Mar-08 7:11
Rocky#17-Mar-08 7:11 
Questionavoiding 1/1/1900 in SQL SERVER? Pin
John Sundar14-Mar-08 23:03
John Sundar14-Mar-08 23:03 
GeneralRe: avoiding 1/1/1900 in SQL SERVER? Pin
Rocky#15-Mar-08 1:06
Rocky#15-Mar-08 1:06 
GeneralRe: avoiding 1/1/1900 in SQL SERVER? Pin
Mark J. Miller17-Mar-08 4:54
Mark J. Miller17-Mar-08 4:54 
GeneralBest Practice: Connection Strings to MS-SQL datasource from web application Pin
Leo Smith14-Mar-08 9:18
Leo Smith14-Mar-08 9:18 
GeneralRe: Best Practice: Connection Strings to MS-SQL datasource from web application Pin
Mark J. Miller17-Mar-08 5:07
Mark J. Miller17-Mar-08 5:07 
GeneralStoring Compressed Image Into SQL Server Pin
abdurrahman oğuz14-Mar-08 6:30
abdurrahman oğuz14-Mar-08 6:30 
GeneralRe: Storing Compressed Image Into SQL Server Pin
Rob Philpott14-Mar-08 6:38
Rob Philpott14-Mar-08 6:38 
GeneralRe: Storing Compressed Image Into SQL Server [modified] Pin
abdurrahman oğuz14-Mar-08 22:40
abdurrahman oğuz14-Mar-08 22:40 
GeneralRe: Storing Compressed Image Into SQL Server Pin
Mark Churchill16-Mar-08 1:57
Mark Churchill16-Mar-08 1:57 
Generalinsert user checkboxlist selections in table Pin
C. L. Phillip14-Mar-08 4:26
C. L. Phillip14-Mar-08 4:26 
GeneralRe: insert user checkboxlist selections in table Pin
Mark J. Miller14-Mar-08 6:28
Mark J. Miller14-Mar-08 6:28 
GeneralRe: insert user checkboxlist selections in table Pin
C. L. Phillip14-Mar-08 9:36
C. L. Phillip14-Mar-08 9:36 
GeneralPlease help me move these records to another table... Pin
Support12314-Mar-08 3:10
Support12314-Mar-08 3:10 
GeneralRe: Please help me move these records to another table... Pin
soni uma14-Mar-08 3:20
soni uma14-Mar-08 3:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.