|
-
Heterogeneous queries
Hi All,
Can someone please tell me what does this means. and How to solw this problem.
This is my procedure that I created.
CREATE PROCEDURE stp_Test @TableName varchar(50), @Id int out AS
DECLARE @String varchar(500)
SELECT @String = 'SELECT * INTO #TempTable FROM ServerName.Database.dbo.' + @TableName
EXEC sp_sqlexec @String
SELECT @id = max(ID) FROM #TempTable
GO
WHEN I run this Procedure.
EXEC stp_Test 'TableName', @Id out
I get this out put.
-------------------------------------------------------
SELECT * INTO #TempTable FROM ServerName.Database.dbo.TableName
(1 rows affected)
Server: Msg 7405, Level 16, State 1, Procedure stp_MaxNoReturn, Line 2
Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query.
What is the solution to this problem.
Thanks in advance
Aziz
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|