Insert into a table using a view
I have some data in a view which I want to insert into a table (same table schema) what's the easiest, cleanes开发者_如何转开发t way to do it.
Insert Into dbo.MyTable (Col1, Col2,...)
Select Col1, Col2, ...
From dbo.MyView
if you want to insert the entire column then you can do like
insert into table_name
select * from view_name
insert into mytable(c1, c2, c3, ...)
select c1, c2, c3, ... from myview
精彩评论