Transact sql error message Msg 4511 Level 16 - Create View or Function failed because no column name was specified - means that in your view exist an concatenated column composed of multiple columns and has not declared an alias.
Msg 4511 Level 16 Example:
Invalid create view:
USE model;
GO
CREATE VIEW studentsList AS
SELECT id, CONCAT(first_name,' ',last_name), gender
FROM students
GO
Message |
---|
Msg 4511, Level 16, State 1, Procedure studentsList, Line 2 |
Create View or Function failed because no column name was specified for column 2. |
Correct create view:
USE model;
GO
CREATE VIEW studentsList AS
SELECT id, CONCAT(first_name,' ',last_name) full_name, gender
FROM students
GO
Message |
---|
Command(s) completed successfully. |
Other error messages:
- Cannot drop the table
- Is not a constraint
- Cannot define PRIMARY KEY constraint on nullable column in table
- Column is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause
- String or binary data would be truncated
- The database name component of the object qualifier must be the name of the current database
- No item by the name of '%' could be found in the current database.