select a.princname as Perusahaan, a.prodgrp as [Grup Product],
a.prcod as [Code Product], a.Singkatan, a.prdesc as Product,a.uosf as [Isi per Box],
a.uom as Satuan into MasterProduct
from openrowset('MSDASQL','Driver={SQL Server};Server=10.126.119.253;UID=sa;PWD=indomarcocoid', pps_product.dbo.cmdmaster) as a
Then how to read that magic code? Lets check it out!
- a.princname as Perusahaan : which means showed princname column as Perusahaan on label's column; a in front of princname refers to new table that builded.
- openrowset('providername','accesskey','tablename') : is used to open database and table from another server
select a.*
from openrowset('MSDASQL','Driver={SQL Server};Server=10.126.119.253;UID=sa;PWD=indomarcocoid',
pps_product.dbo.cmdmaster) as a

No comments:
Post a Comment