Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 从SQL Server到postgresql的数据库链接:获取序列nextval_Sql Server_Postgresql_Rpc_Dblink - Fatal编程技术网

Sql server 从SQL Server到postgresql的数据库链接:获取序列nextval

Sql server 从SQL Server到postgresql的数据库链接:获取序列nextval,sql-server,postgresql,rpc,dblink,Sql Server,Postgresql,Rpc,Dblink,我的SQL Server 2008需要连接到POSTGRESQL 9.0服务器 我需要的任务之一是通过POSTGRESQL获取序列的下一个值 示例1: execute ('select nextval( ''cadastro.pessoa_seq'' )' ) at POSTGRESQL ; select * from openquery( POSTGRESQL ,'select nextval( ''cadastro.pessoa_seq'' )') 错误: Msg 7215,级别17,状

我的SQL Server 2008需要连接到POSTGRESQL 9.0服务器

我需要的任务之一是通过POSTGRESQL获取序列的下一个值

示例1:

execute ('select nextval( ''cadastro.pessoa_seq'' )' ) at POSTGRESQL ;
select * from openquery( POSTGRESQL ,'select nextval( ''cadastro.pessoa_seq'' )')
错误:

Msg 7215,级别17,状态1,第1行无法在上执行语句 远程服务器“POSTGRESQL”*

示例2:

execute ('select nextval( ''cadastro.pessoa_seq'' )' ) at POSTGRESQL ;
select * from openquery( POSTGRESQL ,'select nextval( ''cadastro.pessoa_seq'' )')
错误:

Msg 7399,第16级,状态1,第1行,用于 链接服务器“POSTGRESQL”报告了一个错误。提供商报告了一个错误 意外的灾难性故障。信息7350,16级,状态2,第1行 无法从的OLE DB提供程序“MSDASQL”获取列信息 链接服务器“POSTGRESQL”*

这些选项都不起作用

有什么好的选择吗


提前感谢您处理ODBC源代码和Postgre我必须这样做:

nextval(''cadastro.pessoa_seq''::regclass) for it to work 

可能您的Postgresql连接是只读的,您是否尝试执行更新/插入请求

下次更新序列时,请尝试:

currval(''cadastro.pessoa_seq''::regclass)

“不起作用”到底是什么意思?你有错误吗?如果是,从哪个数据库管理系统?我更新了帖子。我在SQLSERVER中得到了错误。TIA您是否可以将该连接用于其他查询?是的,我可以执行“从[…]选择*”!我在执行远程功能、序列时遇到问题。。。!