Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am trying to create a table in mssql with an ID like this PIWC/ATOM/VISIT/000001

I tried but get the error "Msg 207, Level 16, State 1, Line 5 Invalid column name 'Visitorid'"
this is the code please help me out

raiserror('creating Visitors table....',0,1)
CREATE TABLE tblVisitors
(Visitorsid int IDENTITY(1,1) NOT NULL,
FormattedVisitorid AS ('PIWC/ATOM/VISIT/' + RIGHT ('000000' + CAST(Visitorid AS VARCHAR(6)),6)), 
Visitdate datetime,
Assemblys varchar(30)not null,
Surname varchar(100)not null,
Othername varchar(100)not null,
Gender varchar(10),
Telephone varchar(50),
Residentialaddress varchar(300),
Visiting varchar(300),
Membership varchar(100),
Acceptjesus varchar(200),
Others varchar(550))
Posted

1 solution

You need to change "Visitorid" in the 4th line of your code to "Visitorsid" or vice versa.
 
Share this answer
 
Comments
mikeoabban 27-Mar-14 11:57am    
thanks Richard it worked
Richard C Bishop 27-Mar-14 12:00pm    
You are welcome. Please accept this as the answer to your problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900