CREATE TABLE TEST(
Code_test int IDENTITY(1,1) NOT NULL,
shortname varchar(14) NULL,
Name varchar(38) NOT NULL,
CONSTRAINT [PK_TEST] PRIMARY KEY (Code_test)
)
go
--Create a view without the identity column
create view vtest
as
select shortname, name from TEST
go
--You can do some insert into the view like
insert into vtest values ('Test1', 'what a test !')
insert into vtest values ('Test2', 'what a test !')
insert into vtest values ('Test3', 'what a test !')
--------------------------------------
select * from test
--it returns the 3 rows
--------------------------------------
-- you can else do insert directly with the table
insert into test values ('Test 100', 'what a test !')
insert into test values ('Test 101', 'what a test !')
insert into test values ('Test 102', 'what a test !')
select * from test
--it returns the 6 rows