hi, i am trying to implement the follwoing from server A to a linked server B DECLARE @IDENT_GEN INT = (SELECT IDENT_CURRENT ('linkedservername.[database].[schema].[tablename]')) select @IDENT_GEN INT Msg 4104, Level 16, State 1, Line 1 The multi-part identifier "server.tablename.schema.tablename" could not be bound. How can i achieve this?
Someone feel free to correct me, but I don't believe that you can call IDENT_CURRENT across a linked server. The scope for that function is for the current session for the server on which it was executed.
http://social.msdn.microsoft.com/Forums/en-US/transactsql/thread/a100b316-c093-4133-8694-90ae862f9c22/ The above link provides a possible solution or you can also create a stored procedure on the remote server to determine the next value. Your query can then execute the remote stored procedure and the results will be returned to the current session. Hope this helps!!