A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Hi @Cabral, Scott ,
Welcome to Microsoft Q&A!
--DDL
create table tablec
(ReserveID int,
SequenceNum int)
insert into tablec values
(7931,1),
(793,31)
You could try to multiply one with a high enough value.
SELECT ReserveID * 1000 + SequenceNum from tablec
--7931001
--793031
Or use text concatenation:
SELECT CAST(CAST(ReserveID AS nvarchar(10)) + RIGHT('0' + CAST(SequenceNum AS nvarchar(10)), 6) AS int)
from tablec
--793101
--793031
Or skip the integer thing and separate the IDs with something non-numeric:
SELECT CAST(ReserveID AS nvarchar) + ':' + CAST(SequenceNum AS nvarchar)
from tablec
--7931:1
--793:31
Best regards
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.