简体   繁体   中英

SQL-syntax error

What is wrong with this SQL-syntax?

INSERT INTO chatt (user, msg, ip) VALUES('testUser', 'testMsg', '81.235.154.103')

The server is running some IIS with an unknown SQL version, but the files has to be in access 2000-format. The fields i've got are id, user, msg, ip, datum. 1st one is a counter, last one is a date/time and the rest are text fields. How do i insert into those three fields?

user may be a reserved word. Try putting it in brackets [user]

Without the actual error message we can't really tell, but two obvious things jump out:

  • user is a reserved word; enclose it in square braces: [user]
  • Your datum field may be not null , which means you need to provide a value for it in your statement.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM