Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
scanpj10
Starting Member
1 Post |
Posted - 2015-01-14 : 10:35:26
|
I am looking to create a new view by combining two tables, but i would like to create a new column in the view that identifies what table the data came from. For example I have a Table A and Table B, using a union i combined the two table but i want a new column titled Source which could be populated by A or B.This is my code so far:Create View Table_AB AsSelect *From Table_AUnion AllSelect*From Table_BAny help would be greatly appreciated |
|
mhorseman
Starting Member
44 Posts |
Posted - 2015-01-14 : 11:17:26
|
Something like:Create View Table_AB AsSelect 'A' source,* From Table_AUnion AllSelect 'B',* From Table_BMark |
|
|
|
|
|