Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2008 > SQL Server 2008
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2008 General discussion of SQL Server *2008* version only - not related to a specific book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2008 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 7th, 2015, 01:27 PM
Friend of Wrox
Points: 422, Level: 7
Points: 422, Level: 7 Points: 422, Level: 7 Points: 422, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: La Jolla, CA, USA.
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Default DTS Package Equivalent

I've been using SQL Server 2000 for some time now, using a DTS package to import larges amounts of data on a monthly basis...

Believe it or not, the only thing that kept me from upgrading to 2008 was that some time ago, I tested the ability to import large amounts of data into SQL Server 2008, and it was very slow using the "Import and Export" wizard in 2008.

I use Access MDB as container files for the data tables.

What is the preferred method to import large data tables into SQL Server 2008?
Reply With Quote
  #2 (permalink)  
Old April 7th, 2015, 09:12 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

if its 2008r2 research tableDiff. Its amazing. The source and destination tables must be identical in structure. I use a .bat file running on a windows Scheduled task to sync databases from one server/DB to another every night. Here is the .bat file. Only very small changes on lines 13-28 are required to use it, they should be very obvious.

Note - No changes are required to the :processTable function at the bottom

Code:
@ECHO OFF
color c0
echo.********************************************************************************
echo. Starting %CD% %date% %time%
echo ********************************************************************************
echo. 

echo ***********************************************************
echo * Set up tablediff and logs paths
echo ***********************************************************
echo.

SET folderDiffs=D:\Inetpub\Scripts\temp\folderToSavwSQLFiles
SET LogFolder=D:\Inetpub\Scripts\Logs\folderNameForLog
SET exeTableDiff="C:\Program Files\Microsoft SQL Server\100\COM\Tablediff.exe"
SET exeSqlCmd="C:\Program Files\Microsoft SQL Server\100\Tools\Binn\sqlcmd.exe"

SET sourceServer=ServerName
SET sourceDatabase=DBName
SET sourceUser=UName
SET sourcePassword=pWord

SET destinationServer=ServerName
SET destinationDatabase=DBName
SET destinationUser=UName
SET destinationPassword=pWord

SET tables=tableOne, tableTwo, tableThree

for %%i in (%tables%) do (call :processTable %%i)
 

echo.********************************************************************************
echo. Finished %date% %time%
echo ********************************************************************************
echo. 

goto :end

:processTable
	SET sourceTable=%1
	SET destinationTable=%sourceTable%
	echo.********************************************************************************
	echo. Starting %date% %time%
	echo.
	echo. Processing %sourceTable%
	echo.********************************************************************************
	del /f /q %folderDiffs%\diffs_%sourceTable%.sql
	%exeTableDiff% -sourceserver %sourceServer% -sourcedatabase %sourceDatabase% -sourcetable %sourceTable% -sourceuser %sourceUser% -sourcepassword %sourcePassword% -destinationserver %destinationServer% -destinationdatabase %destinationDatabase% -destinationtable %destinationTable% -destinationuser %destinationUser% -destinationpassword %destinationPassword% -f %folderDiffs%\diffs_%sourceTable%.sql > %LogFolder%\diffs_%sourceTable%.log
	If Exist %folderDiffs%\diffs_%sourceTable%.sql %exeSqlCmd% -S %destinationServer% -d %destinationDatabase% -U %destinationUser% -P %destinationPassword% -i %folderDiffs%\diffs_%sourceTable%.sql

:end
__________________
Wind is your friend
Matt
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with DTS PACKAGE mxwebb SQL Server DTS 1 November 28th, 2007 04:16 PM
DTS PACKAGE QUESTIONS girl SQL Server DTS 0 June 6th, 2007 02:58 AM
question on DTS package kpshende SQL Server 2000 0 April 22nd, 2006 07:08 AM
DTS Package failing ros1188 SQL Server DTS 1 August 17th, 2005 08:27 AM
Scheduling DTS Package chiefg SQL Server DTS 11 April 30th, 2004 11:18 AM



All times are GMT -4. The time now is 06:38 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.