Share via

Statement causes error

BenTam 1,806 Reputation points
2024-03-16T08:29:12.0633333+00:00

Dear All,

What's wrong with the statement "create index engnamestuid on engname + cast(student as nvarchar(6))"?

TsqlError

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL

A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.

0 comments No comments

Answer accepted by question author

Olaf Helper 47,621 Reputation points
2024-03-16T09:09:57.88+00:00

DDL statements like CREATE INDEX requires fix literal, you can not use "calculated object names".

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most 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.