关键字“交易”附近的语法不正确 [英] Incorrect syntax near the keyword 'Transaction'

查看:177
本文介绍了关键字“交易”附近的语法不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用SQL Server Management Studio 2008并编写以下查询

I am using SQL Server Management Studio 2008 and writing the following query

INSERT INTO Transaction (TransactionType, AccountID, HolderName, Amount, CurrDate) 
VALUES ('Cash Withdrawal', '25', 'abc', '1000', 'abc');

且表的脚本为

SELECT TOP 1000 [ID]
      ,[TransactionType]
      ,[AccountID]
      ,[HolderName]
      ,[Amount]
      ,[CurrDate]
  FROM [ATMSoftware].[dbo].[Transaction]

并且 ID 是主键并自动递增。但是我收到了插入查询的错误

and ID is the primary key and auto incremented. But I am getting the error on the insert query


关键字Transaction附近语法不正确。

Incorrect syntax near the keyword 'Transaction'.

请帮助我

尊敬

推荐答案

INSERT INTO [Transaction](TransactionType, AccountID, HolderName, Amount, CurrDate) 
VALUES ('Cash Withdrawal', '25', 'abc', '1000', 'abc');

这一定会为你工作...因为Transaction是一个 KeyWord 在sql管理。
i也有类似的问题一次, [] 帮助我出来了。

This will surely work for you...Because Transaction is a KeyWord in sql management. i also had similar problem once and [] helped me to come out of it.

或接受如果它为你工作。

Vote up or accept if it works for you..

这篇关于关键字“交易”附近的语法不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆