SQL Server Invalid column name when adding string value

后端 未结 5 797
一向
一向 2021-01-18 15:23

I\'m new to SQL Server

I\'ve created my table like this:

CREATE TABLE Accidents (
     Id INT NOT NULL PRIMARY KEY IDENTITY,
     GUID VARCHAR(100),         


        
5条回答
  •  执笔经年
    2021-01-18 15:49

    you need single quotes to string values

    But I strightly recommend you to use SQLParameters to avoid any SQLInjections attacks

    You can find examples of using SQL Parameters here

提交回复
热议问题