Share via

Synapse Stored Procedure

Sasidhara Rao Bade 5 Reputation points
2023-10-22T15:59:53.5666667+00:00
Hi I am getting below Error

Stored procedure1
{
    "errorCode": "2402",
    "message": "Execution fail against sql server. Please contact SQL Server team if you need further support. Sql error number: 156. Error Message: Incorrect syntax near the keyword 'SELECT'.",
    "failureType": "UserError",
    "target": "Stored procedure1",
    "details": []
}

Note :- While i am running Stored procedure it is success

USE gold_db
GO

Azure Synapse Analytics
Azure Synapse Analytics

An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.


1 answer

Sort by: Most helpful
  1. Erland Sommarskog 134.7K Reputation points MVP Volunteer Moderator
    2023-10-22T20:11:17.3566667+00:00

    Change

       SET @statement = N'CREATE OR ALTER VIEW '+@ViewName+'AS
    
    
    

    to

       SET @statement = N'CREATE OR ALTER VIEW '+@ViewName+' AS
    

    That is, you need a space before AS.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.