'Creates SalesPoint record for computer name
strSQL = "if not exists (select * from SalesPoints where Slpnumber = 999) " + vbCrLf
strSQL = strSQL + "Declare @counter int exec @counter=getnextcounter 999,'TableSalesPoints'" + vbCrLf
strSQL = strSQL + "Insert into SalesPoints Select @counter,1,999,'" + Environment.MachineName + "','',0.00,2,0.00,0,0,0,0.00,1,1,1,1,1,0,1,getdate(),0,'','',0,0,0,0,0,0,1001,'" + Environment.MachineName + "'"
I run it but it just keeps creating a new entry in the table even though there is already a record with a slpNumber=999
strSQL = "if not exists (select * from SalesPoints where Slpnumber = 999) " + vbCrLf
strSQL = strSQL + "Declare @counter int exec @counter=getnextcounter 999,'TableSalesPoints'" + vbCrLf
strSQL = strSQL + "Insert into SalesPoints Select @counter,1,999,'" + Environment.MachineName + "','',0.00,2,0.00,0,0,0,0.00,1,1,1,1,1,0,1,getdate(),0,'','',0,0,0,0,0,0,1001,'" + Environment.MachineName + "'"
I run it but it just keeps creating a new entry in the table even though there is already a record with a slpNumber=999