An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as “” or [] are not allowed. Add a name or single space as the alias name.

Error Message:
Msg 1038, Level 15, State 5, Line 1
An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as “” or [] are not allowed. Add a name or single space as the alias name.

Severity level:
15.

Description:
This error message appears when in a SELECT INTO statement not every column has a unique name.

Consequences:
The T-SQL statement can be parsed, but causes the error at runtime.

Resolution:
Errors of the Severity Level 15 are generated by the user and can be fixed by the SQL Server user. The statement cannot be executed this way. All columns in a SELECT INTO statement must have a unique name.

Versions:
All versions of SQL Server.

Example(s):
SELECT
    *
INTO
    #t
FROM
    (SELECT 1) x

Remarks:
In the above example we try to create the table #t via a SELECT INTO statement. Because the first expression in the SELECT list of the derived table does not have a name, the error is raised.




Array

No comments yet... Be the first to leave a reply!