Hi!
I'm using a Linked Server in SQL Server 2005 to connect to C/ODBC, and it work fine.
http://www.codeguru.com/vb/vb_internet/ ... php/c8903/
My problem is when I try to declare a variable (
@Timestamp) in my stored procedure, it says "Column not found:
@Timestamp". I can't see what’s wrong, any idée’s?
Create PROCEDURE ActionLog
@Timestamp nvarchar(50) as
DBCC TRACEON(8765) SELECT * FROM OPENQUERY(NAVISION, 'SELECT * FROM "Action Log" WHERE "Timestamp Wipcore"=
@Timestamp')
RETURN
GO
Best regards
Patric
Comments
If you would like to pass a parameter you must define a query as "string" and then execute a sp_execute_sql sentence, as this example:
DECLARE @IntVariable INT
DECLARE @SQLString NVARCHAR(500)
/* Build and execute a string with one parameter value. */
SET @IntVariable = 35
SET @SQLString = N'SELECT * FROM pubs.dbo.employee WHERE job_lvl = ' +
CAST(@IntVariable AS NVARCHAR(10))
EXEC(@SQLString)
/* Build and execute a string with a second parameter value. */
SET @IntVariable = 201
SET @SQLString = N'SELECT * FROM pubs.dbo.employee WHERE job_lvl = ' +
CAST(@IntVariable AS NVARCHAR(10))
EXEC(@SQLString)
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!