USE tempdb
GO
CREATE TABLE Test(
CandID as 'C-' + RIGHT('000' + CONVERT(varchar, CourseID),5),
CourseID int IDENTITY(1,1),
ReferrerName varchar(10)
)
INSERT INTO Test VALUES ('MIKE')
INSERT INTO Test VALUES ('KELLY')
INSERT INTO Test VALUES ('NICK')
INSERT INTO Test VALUES ('James')
INSERT INTO Test VALUES ('Jones')
INSERT INTO Test VALUES ('Nick')
SELECT * FROM Test
Thanks
GO
CREATE TABLE Test(
CandID as 'C-' + RIGHT('000' + CONVERT(varchar, CourseID),5),
CourseID int IDENTITY(1,1),
ReferrerName varchar(10)
)
INSERT INTO Test VALUES ('MIKE')
INSERT INTO Test VALUES ('KELLY')
INSERT INTO Test VALUES ('NICK')
INSERT INTO Test VALUES ('James')
INSERT INTO Test VALUES ('Jones')
INSERT INTO Test VALUES ('Nick')
SELECT * FROM Test
Thanks
No comments:
Post a Comment