Hi,
I have a function which is like this
DECLARE @oldmax bigint, @newmax bigint
SELECT @oldmax = max(exportTimestamp) FROM EXPORT_TIMESTAMPS
IF @oldmax IS NULL
SET @oldmax = 0
SELECT * FROM ServerA.TableA.fnExportTrafficTS(@oldmax) ORDER BY storeID, TrafDate
SELECT @newmax = max(timestamp) FROM TRAFFIC t
IF @newmax > @oldmax
INSERT INTO EXPORT_TIMESTAMPS
VALUES(@newmax, GETDATE())
And now i need to insert the data coming out of this function into ServerB Table B
And the column names and everything coming out of the function is the same columns in Table B.So, no need to worry there.
I have never worked with inserting data from function through linked server.
Can someone please help me with this?
Thanks,
Sujith
I have a function which is like this
DECLARE @oldmax bigint, @newmax bigint
SELECT @oldmax = max(exportTimestamp) FROM EXPORT_TIMESTAMPS
IF @oldmax IS NULL
SET @oldmax = 0
SELECT * FROM ServerA.TableA.fnExportTrafficTS(@oldmax) ORDER BY storeID, TrafDate
SELECT @newmax = max(timestamp) FROM TRAFFIC t
IF @newmax > @oldmax
INSERT INTO EXPORT_TIMESTAMPS
VALUES(@newmax, GETDATE())
And now i need to insert the data coming out of this function into ServerB Table B
And the column names and everything coming out of the function is the same columns in Table B.So, no need to worry there.
I have never worked with inserting data from function through linked server.
Can someone please help me with this?
Thanks,
Sujith