I am querying a data from two different servers and now I want to store it on another table so that I can use it as my reference table in my program.. (I am using ASP.NET in programming)
Have a look on my command and please advise what to do.
SELECT c.[pf_id]
,a.[RequestDate]
,c.[pf_carrierUsed]
,b.[PiecePrice] * b.[PartQuantity]
,c.[pf_type]
,c.[pf_resSupplier]
,c.[pf_resCustomer]
,c.[pf_trailerNum]
,b.[PartDesc]
,c.[pf_chargeBack]
,c.[pf_chargetoPlant]
FROM [CNCTC-WEB01].[NOP_PR].[dbo].[Requests] a
JOIN [CNCTC-WEB01].[NOP_PR].[dbo].[Parts] b on a.[RequestID] = b.[RequestID]
JOIN [PHRIZ-WEBAPP01].[PFTracking].[dbo].[Tbl_PFExcel] c on b.[PartNumber] like '%'+c.pf_id+'%'
where a.[EntityName] like '%PTA'
AND a.[RequestDate] between '2015-04-20 00:00:00.000' AND GETDATE()
The result of this query is what I wanted to store in another table so that I could use it.
Additional :
When I do all use temp_tables i always get :
String or binary data would be truncated.