-1

Here AS is dbname and dbo is schema and MULTIPLE_SUBSCRIBERS is a table.

Error as follows:

enter image description here

Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'AS'.

Kindly help.

Community
  • 1
  • 1
Venkatesh K
  • 145
  • 2
  • 5

1 Answers1

2

AS is a keyword. The way you added it to the sql statement tells SQL Server to interpret it as such.

To use the database name AS, you need to use the following:

SELECT * FROM [AS].dbo.MULTIPLE_SUBSCRIBERS;

When using square bracket, SQL Server will always interpret the text as a name. This also works for names with spaces. For more see: What is the use of the square brackets [] in sql statements?

rollstuhlfahrer
  • 3,988
  • 9
  • 25
  • 38