- SQL code
IF NOT EXISTS(SELECT * FROM Company WHERE MAC='aa:22:cc:22:ee:ff') INSERT INTO Company(Mac,CompanyId,CompanyName,FtpParameter) Values('aa:22:cc:22:ee:ff','00101','aabbcc','192.168.123.11|21|abc|abc')
为什么提示:
Error message: SQL script is wrong
------解决方案--------------------
- SQL code
create table #t(Mac varchar(50),CompanyId varchar(50),CompanyName varchar(50),FtpParameter varchar(50))IF NOT EXISTS(SELECT * FROM #t WHERE MAC='aa:22:cc:22:ee:ff')INSERT INTO #t(Mac,CompanyId,CompanyName,FtpParameter) Values('aa:22:cc:22:ee:ff','00101','aabbcc','192.168.123.11|21|abc|abc')select * from #t Mac CompanyId CompanyName FtpParameter-------------------------------------------------- -------------------------------------------------- -------------------------------------------------- --------------------------------------------------aa:22:cc:22:ee:ff 00101 aabbcc 192.168.123.11|21|abc|abc(1 行受影响)drop table #t---没问题
------解决方案--------------------
估计就是类型的问题。。。楼主你在写语句的时候转换下试试
------解决方案--------------------
------解决方案--------------------