May 2, 2012 at 1:51 pm
SQL Server 2005 Enterprise Edition - SP3
The problem I have is that I am wanting to create a batch file to simply compare database tables between our PROD database, and our TEST database, but they are on different servers which are not linked.
I have the following...
C:\>"C:\Program Files\Microsoft SQL Server\90\COM\tablediff.exe" -sourceserver .\PRO-DBSERVER4A -sourcedatabase FLEET-V3 -sourcetable dbo.BW_DH_TRUCK -destinationserver .\PRO-DBSERVER4B -destinationdatabase V3_2 -destinationtable dbo.BW_DH_TRUCK -et dbo.Difference -f C:\Software\BW_DH_TRUCK_DIFF.sql
I have checked to make sure I have adequate permissions to run the batch, and have SSMS opened up to my TEST instance, and the PROD instance connected as well, but when I attempt to run the batch file - the DOS window comes up real quick, disappears, and nothing is performed. I am not sure how to get the DOS window to pause to see if errors are happening, and the TableDiff.exe file ends up being zeroed out in it's directory (normally about 83kb, but goes to 0k after I try to run the batch file).
Any and all thoughts would be appreciated
May 2, 2012 at 1:58 pm
You don't get to review the command prompt (DOS) output from a batch file run that way. You have to run the command manually in the command prompt to see what might be in that window.
The most likely issue is that you have -et, but not -dt in the command. The documentation says if the log table already exists, or might, you need to use -dt to drop it before -et can create it. It probably ran correctly the first time, and then ran into that issue and stopped working.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
May 2, 2012 at 3:06 pm
Hey G!
I thought this same thing too, but wouldn't it have then also generated my request sql file?
I didn't see a temp or perm table with my table name, nor did it gen the sql.
I will trying running it from the command prompt instead of a batch file, but the last time I tried that I got an error stating that tablediff.exe is not a valid win32 app.
:unsure:
May 2, 2012 at 3:20 pm
Got it to work this time...Ran it manually like your suggested instead of from a batch. Seems well except for my results! :w00t:
Thanks again G!
May 3, 2012 at 7:13 am
What did you have to change?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
May 3, 2012 at 10:56 am
Look at my code above...Knuckle-headed me had a '>' in there at the beginning of the path.
:w00t:
May 3, 2012 at 12:58 pm
Aha!
Yeah, it's usually some silly little thing like that.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply