Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

Escaping T-SQL Keywords

Asked by Cameron Oliver Sep 11, 2021 1.2K views 1 answer
Share

About this question

$sql = "SELECT Kill FROM tbl_pvporderview"; Problem is that I end up with: Incorrect syntax near the keyword 'Kill'. Because kill is a T-SQL command... any way to bypass it? I can't change the column name because it's used by the software a lot and I cant change the software that's using the database. So it simply fails if I use sqlserv to select data from that column. '' or "" wont help. The complete statement would be: $sql = "SELECT serial,Kill FROM tbl_pvporderview WHERE Kill > (?) ORDER BY Kill DESC "; What are sql server reserved words?

Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.