Question

I am trying to run a basic T-SQL script

    DECLARE @temptable TABLE(
      abilityTypeId BIGINT NOT NULL,
      companyId BIGINT NOT NULL
    );

    INSERT INTO @temptable(abilityTypeId, companyId)
    VALUES (1, 2);

    SELECT * FROM @temptable;

but I get the following error:

SQL Error [1087] [S0002]: Must declare the table variable "@temptable". Must declare the table variable "@temptable".

MERGE INTO is also not working. Is it possible to get this working on Linux or do I have to use Visual Studio for this?

Was it helpful?

Solution

DBeaver parses queries one by one using a statement delimiter (“;” by default) and executes them consecutively.

Try removing the empty lines and those “;”.

Check more details here.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top