问题
I am using Sybase database ISQL.exe. when I declare a table variable using this clause:
declare @tabVar table (fid int, name varchar(10))
I got error: could not execute statement. Incorrect syntax near the keyword 'table'
I don't see where is wrong, could any one help?
回答1:
It's not correct construction. You can't use table type variable in sybase. For this solution I suggest to use temporary table as below:
create table #tabVar
(
fid int,
name varchar(10)
)
回答2:
This must be new in Sybase; I am using it now.
DECLARE LOCAL TEMPORARY TABLE @tabVar (fid int, name varchar(10))
来源:https://stackoverflow.com/questions/13357366/incorrect-syntax-near-the-keyword-table-when-i-declare-a-table-variable