>My companytable got over 35 fields (include 4 address field nvarchar(50)X 4, contact person.. etc)
>Now I need to insert to company code and company name into a temp table.
>
>(1) insert into myTemp(...) select .... from companytable
>OR
>(2) I create a view first which only select 10 fields from companytable
>insert into myTemp(....) select .. from myView
>
>Which is faster ?
>Thanks
Internally on the server my guess is that (1) might be slightly faster as SQL Server doesn't seem to optimize views well. The speed difference is probably very small unless you have a lot of records or you are putting some nonoptimized conditions in the query.
____________________________________
Don't Tread on Me
Overthrow the federal government NOW!
____________________________________