Showing posts with label match. Show all posts
Showing posts with label match. Show all posts

Friday, March 30, 2012

Renaming Destination in DTS

I searched, but couldn't find anything to match what I am looking for...

Basically, is there any way to tell DTS to create a new table each time that the backup is run? I am scheduling the backup for 1 hour intervals for 5 days, but need the databases that are backed up to be unique, so i would end up wiht 120 of them total.

Is there any way to do this through DTS? Or am I hosed?

Thanks in advanceYep, you can do it. You'll have to adapt what's in the links, but it does work. You can pass variables into a DTS job and have it alter execution each time it's run.

http://www.swynk.com/friends/green/textfile.asp
http://www.swynk.com/friends/green/DTSHowTo3.asp

http://www.sqldts.com/
http://www.dts2000.com/

Monday, March 26, 2012

Rename Server

I am using SQL Server 2005 in a test environment and I want to rename the server to match my production environment. Currently the name is the same as my computer name. Can it be changed? Do I have to change my computer name? (My computer is not on the same network so it is possible).Renaming the server ... I would go there. It's probably easier to backup all databases, uninstall the SQL server, reinstall it and restore the backups. If it only is for remote connections, you can also create a DNS alias for the machine it's running on. Your network admin can help you with that.
Renaming the machine has also some nice caveats, we went there and we ended up reinstalling the whole machine ... again, don't go there !

Gr,
Yveau|||you can get around having to reinstall after renaming a machine by using sp_dropserver and sp_addserver and then restarting the sql services.

however I think this guy does not want the sql server instance to have the same name as a machine for whatever reason. it kind of annoys me anytime I get a request to rename anything (a machine, a database, table, column etc...) in sql server. it s always about someone's personal preference or some new naming convention that will expire with his\her employment and there is always some peice of code or a connection string that not get updated somewhere which causes some problem.|||it s always about someone's personal preference ...

Even better, some user's preference. And looking at my signature, you might guess how I feel about that. :p
I totaly agree with you, renaming is completely useless. After all the interfacing is not done in the database. If you want something nice on the screen, write a decent GUI. Don't start renaming the database ...

Gr,
Yveausql

Wednesday, March 7, 2012

Removing HASH Match / Inner Join

Hi,

I'm at my wits end! I have two large tables one with 1.2mill one with 2.3 mill and they are very wide tables. I have a select with an inner join. All columns used in the join are contained in indexes. But it does an index scan and a massive hashmatch. Why is this? both tables have columns in the index ordered the same, all datatypes of the indexes are ints. The code looks like this.

SELECT TblActivities.*
FROM TblActivities
INNER JOIN TblBookingsCraig
ON
TblActivities.clientID = TblBookingsCraig.clientid AND
TblActivities.campaignID = TblBookingsCraig.campaignid AND
TblActivities.SupplierID = TblBookingsCraig.SupplierID and
TblActivities.CreativeVersion = TblBookingsCraig.CreativeVersion

Does anyone know why it won't perform an index seek?

Cheers
CYou should have the indexes on the fields you want to join, do you have them like that?

TblActivities.clientID = TblBookingsCraig.clientid AND
TblActivities.campaignID = TblBookingsCraig.campaignid AND
TblActivities.SupplierID = TblBookingsCraig.SupplierID and
TblActivities.CreativeVersion = TblBookingsCraig.CreativeVersion|||Hi,

Thanks for the reply. Yes I do have the indexes identically setup on both tables. Could it be ignoring the indexes because of the size difference of the two tables? One has 1millish and the other 2.5mill ish?

Cheers
C|||Did you check the values of these columns? if they contain duplicate values or highly identical values for number of records; say for 100 records at least the indexes have same values. In this case, the index scan would be the decision that SQL optimizer might take!