Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run it as ascript automatically

Status
Not open for further replies.

makumbi

Programmer
Mar 15, 2011
12
UG
Hi members is there a way of saving this script in a specific folder and i write a code to run it from there automatically and if yes how does that code look like.

GO
SET ANSI_WARNINGS OFF
GO
SET ANSI_NULLS ON
GO

insert into testtbl(phone,address,city)
SELECT phone,address,city
FROM OPENROWSET('MSDASQL',
'DRIVER={SQL Server};SERVER=kabojja6;UID=makumbi;PWD=',
pubs.dbo.authors) AS a
ORDER BY a.au_lname, a.au_fname
 
You could save it as script file and use sqlcmd to run it in windows scheduler.


Borislav Borissov
VFP9 SP2, SQL Server 2000,2005 & 2008.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top