Reputation: 273
Easy question I can't seem to find an easy answer to. Why, in MSSQL, can't I create a " " and a "CONSTANT_TEXT_VALUE" column in the view below? There should be a way of doing this right?
CREATE VIEW TEST_VIEW AS
SELECT DEPT,
SALES,
"" AS BLANK_COLUMN,
"Some Text" AS CONSTANT_TEXT_VALUE
FROM SOME_TABLE
Upvotes: 0
Views: 5157
Reputation: 49260
Use single quote
s.
CREATE VIEW TEST_VIEW AS
SELECT DEPT,
SALES,
' ' AS BLANK_COLUMN,
'Some Text' AS CONSTANT_TEXT_VALUE
FROM SOME_TABLE
Upvotes: 5
Reputation: 1269973
The text delimiter in SQL Server follows the ANSI standard. It is a single quote:
CREATE VIEW TEST_VIEW AS
SELECT DEPT, SALES,
'' AS BLANK_COLUMN, 'Some Text' AS CONSTANT_TEXT_VALUE
FROM SOME_TABLE;
Upvotes: 6