Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Links Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS SQL
Oracle
DB2
MS Access
MySQL
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» Sitemap
Free Newsletters:
DatabaseDaily  
News Via RSS Feed


follow us on Twitter
Database Journal |DBA Support |SQLCourse |SQLCourse2
 

Featured Database Articles

SQL Scripts & Samples

Posted Feb 10, 1998

sp_loadserver.sql

By DatabaseJournal.com Staff



We needed a hands off method to refresh all of the data periodically. So, I created a script. It's relatively clean, but I didn't go for the style points. You'll find good use of dynamic SQL and also nested cursors in this one. (If anyone can come up with a way to get rid of the temp table, I'm all ears. -- Already tried the exec (declare cursor...) method and it didn't work. Also the use database method to change context doesn't work either.) Since this thing requires passwords to be tossed into the code, create this proc with encryption. (Make sure to keep this text copy as you won't be able to reverse engineer this thing once this is done.) I have this in our master database and along with the naming of the proc, don't need to worry about database context. You can then create a task to run this as often as you like. The dboptions that are being set are necessary unless you want to fill up your logs. The only improvements to this we are implementing is a script on each side of this. The first one drops all indexes and the second one recreates them.

For SQL Server 6.5

Author: Mike Hotek


Download Script:
sp_loadserver.sql


Disclaimer: We hope that the information on these script pages is valuable to you. Your use of the information contained in these pages, however, is at your sole risk. All information on these pages is provided "as -is", without any warranty, whether express or implied, of its accuracy, completeness, or fitness for a particular purpose... Disclaimer Continued


Back to Database Journal Home



SQL Scripts & Samples Archives

Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 




Latest Forum Threads
SQL Scripts & Samples Forum
Topic By Replies Updated
sql help!! add 1 August 22nd, 11:58 AM
How To Combine These 2 Queries into 1 Query ? tarek_land 1 June 7th, 08:37 AM
solving query svibuk 1 February 3rd, 06:08 AM
converting from a character string to uniqueidentifier saturnius 4 January 4th, 05:56 AM