need to call a simple function and get the result.
create or replace function fn_order_exist(p_order_ms_id int)
if exists (select 1 from public.orders where order_ms_id=p_order_ms_id) then
OPENQUERY does not understand the parameters.
request to the table can't do
select order_id from pgServer.aac.[public].orders where order_id=1;
TK 2000 and mssql driver does not understand some types of data falling down with errors like:
Server: Msg 7356, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' supplied inconsistent metadata for a column. Metadata information was changed at execution time.
OLE DB error trace [Non-interface error: Column 'self_order' (compile-time ordinal 7) of object '"aac"."public"."orders"' was reported to have a DBCOLUMNFLAGS_ISLONG of 128 at compile time and 0 at run time].