日期:2014-05-18 浏览次数:20564 次
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')
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 ---没问题
------解决方案--------------------
估计就是类型的问题。。。楼主你在写语句的时候转换下试试
------解决方案--------------------