I need expert Sybase Sql help with a query
Posted on 2016-07-25
Can a Sybase expert look at my Sybase sql below. I am building a query and then I need to pass it off to be executed at line 3 below.
The table being truncated is on a linked server, and so I am appending the server name and database name to the exec statement
on line 2 below. However when my query executes I am getting an error message of "Incorrect syntax near the keyword 'exec' ".
I hard coded the prefix parameter on line 1 below, just for illustration of what I am talking about. However that value is actually created
dynamically in the stored procedure, and is not hard coded, like on line 1.
and tell me if it looks correct? I am getting an error message of illegal
1. SET @prefix = 'POCOAPPSRV.DBTest.dbo'
2. SET @sqlString =@prefix + 'exec ' + ' "TRUNCATE TABLE ' + @inParamTableName + '"'