I provide a very simple working example.
CREATE TABLE [test_table]
(
[a] int primary key,
[b] varchar(40),
[c] bigint,
[d] varchar(20),
)
GO
CREATE VIEW [test_view] As SELECT b,a,d FROM test_table
GO
INSERT INTO test_table VALUES (0, 'abc', 2, '2011-10-13')
INSERT INTO test_table VALUES (1, 'abc', 2, '2011-10-13')
INSERT INTO test_table VALUES (3, 'abc', 2, '2011-10-13')
SELECT * FROM test_table
SELECT * FROM test_view
GO
As the table and view populate the msdn ( search ) queries , I can do the following on the view:
UPDATE test_view SET b = 'xyz', d = '2011-10-14' where a = 0
INSERT test_view VALUES ('xyz', 2, '2011-10-14')
DELETE test_view where a = 3
GO
SELECT * FROM test_table
SELECT * FROM test_view
GO
Important: Bulk insert is also allowed.
Good luck with your programming.
source
share