11-04-2016 07:48 AM
11-04-2016 09:50 AM
If you are using Microsoft SQL, the auto increment column is called an identity. If you want to know the identity value after inserting a row, there is an internal SQL function called SCOPE_IDENTITY(). I use this function in my stored procedures to return the identity.
11-04-2016 09:53 AM
I am not so good at DB and working with it throught Labview, also I tried GerdW´s solution with write and load from file but it didnt work as I expected.
Maybe I do something wrong as Im not so experienced in Labview.
Can anybody give there a Vi with the simpliest way for me?
Thank you for your answers anyway 🙂
11-04-2016 09:55 AM
Yes I use MS SQL and i have the same setup for autoincrementing, but that doesnt work when i am loading data to the table
11-04-2016 10:27 AM
Show your table design. I assume you are using Server Management Studio, what happens when you right click the table, Edit Top 200 Rows, and type new data into the table? Do not type in a value for the identity column. Does the identity column increment?
11-06-2016 02:33 PM
The ID column increments if I type the values excepting ID number into the table through management studio, but through labview it doesnt work as well. Its still a mystery why there are differences between inserting values through Management studio and Labview but fortunately after a little modification GerdW´s code work 🙂
11-07-2016 02:22 AM
Many SQL based databases support different ways of writing data to it. For instance PUT and INSERT are different in the internal functionality.
Are you sure that you use the same function in LV as the manager tool uses internally?
However, glad to hear that you managed to implement a solution for your task.
Norbert