I have 4 dimensions with patient data. In each dimension there's an ID for the patients. The only problem is that I have no idea how to merge the 4 dimensions into 1 new dimension.
I would use a merge join, but that doesn't work since I also have patient records with no ID. I can't match the pat...
anyone have any good articles on using a surrogate key like identity over a large varchar as a primary key? Someone has suggested using a varchar(255) which would then be stored in 2 other tables as a FK. I suggested using an identity instead - why store 255 when we could store something much smaller
@Kermit Well, so I'm code reviewing something and they have a table like create table ( name varchar(255)) with the PK being on that column. This is then referenced as a FK for 2 other tables. My suggestion was create table (id int identity PK, name varchar(255)), then reference id in the other tables. They want to know why that's better. I'm looking for any "documentation" or something that I could use to say storing the id instead of the varchar(255) would make more sense.
I think the main issue is indexing. Any index that includes the varchar would be about 10 times wider.
So, 10 times less keys in a page.
(assuming an average of 40-50 chars per value)
And secondary, whether the name is ever going to be updated or not. If yes, you'll have to either have the FKs with cascading updates or do the cascades in code. Either way, updating millions of rows is not good.
I have a string variable that i am trying to pass into omy OLE DB Source query. It looks something like this:
'stuff', 'more', 'stuff2'
I am inserting the variable doing this:
AND T.TEAM_NAME IN (?)
If I actually replace the variable in the query and do:
AND T.TEAM_NAME IN ('stuff', 'more'...