I want to create a new column that has a default value of the primary key in a varchar(10) format. Hows this done?
it’s not done – you cannot assign a default value of another column
why not just convert the value when you run a SELECT?
or, if you’re gonna do it relentlessly on every SELECT, why not set up a view which has the extra column incorporated?
You’re duplicating data though, why would the pk value not suffice?
Our large dataset needs compared regularly against two seperate databases, One stores the pk as a double, the other as a string (wonderful right?) Our local copy of the dataset is only a small portion of the whole system so storing both types of primary keys for joining to both seemed useful.
Ah, I see. A view, as R937 states, sounds like it could be useful here then.
Ah nice. Had not seen or heard of views before now. Thanks for that pointer.