Set primary key with two integers
- by user299196
I have a table with primary key (ColumnA, ColumnB). I want to make a function or procedure that when passed two integers will insert a row into the table but make sure the largest integer always goes into ColumnA and the smaller one into ColumnB.
So if we have SetKeysWithTheseNumbers(17, 19) would return
|-----------------|
|ColumnA | ColumnB|
|-----------------|
|19 | 17 |
|-----------------|
SetKeysWithTheseNumbers(19, 17) would return the same thing
|-----------------|
|ColumnA | ColumnB|
|-----------------|
|19 | 17 |
|-----------------|