|
From: Rob van Erk on 20 Jul 2008 02:44 Does the INSERT (SQL) statement create an unique record identifier and how can I get that identifier using VO (Vo2Ado)? I read a lot in this forum about defining unique record numbers (especial for DBF's) but wonder if I have to follow same kind of procedures (as mentioned by different visitors of this forum) when using SQL. What I want is to ensure unique record numbers/identifiers are stored in my SQL DB, they should not be visible for the user (so, exclude them from my bBrower) and the contents of this "record identifier field" will be used when updating records, etc. At least, that's is my perception of the approach to be followed. What procedure is the best one to follow? I read something about 'Select @@Identity' (which will give you the latest generated Id of your connection) but think is not what I need. Any help is appreciated. Thks, Rob
From: Ginny Caughey on 20 Jul 2008 06:37 Rob, I use Guids and have a default value of NewSequentialId() for my SQL Server tables. This creates an idea that is unique across databases. -- Ginny Caughey www.wasteworks.com "Rob van Erk" <erk.v(a)hotmail.com> wrote in message news:1536e91e-6a1e-43ab-9d75-8eeee9e7fa95(a)s50g2000hsb.googlegroups.com... > Does the INSERT (SQL) statement create an unique record identifier and > how can I get that identifier using VO (Vo2Ado)? I read a lot in this > forum about defining unique record numbers (especial for DBF's) but > wonder if I have to follow same kind of procedures (as mentioned by > different visitors of this forum) when using SQL. What I want is to > ensure unique record numbers/identifiers are stored in my SQL DB, they > should not be visible for the user (so, exclude them from my bBrower) > and the contents of this "record identifier field" will be used when > updating records, etc. At least, that's is my perception of the > approach to be followed. > > What procedure is the best one to follow? I read something about > 'Select @@Identity' (which will give you the latest generated Id of > your connection) but think is not what I need. > > Any help is appreciated. > > Thks, > Rob >
From: Rob van Erk on 20 Jul 2008 15:18 Ginny, Thks. Not sure what you mean with GUID. In what way can a Vo-App create the GUID which, I assume, is a unique number that can be used in the SQL Table? Rob
From: Ginny Caughey on 20 Jul 2008 16:27 Rob, The VO app doesn't create the GUID. The SQL Server engine does when you enter a new record and the default value for a column is NewId() or NewSequentialId() and you don't specify some other value. In SQL Server the column type is UniqueIdentifier. -- Ginny Caughey www.wasteworks.com "Rob van Erk" <erk.v(a)hotmail.com> wrote in message news:7aa3ba05-0285-4b01-8901-6ce8b2427a3e(a)8g2000hse.googlegroups.com... > Ginny, > > Thks. > > Not sure what you mean with GUID. In what way can a Vo-App create the > GUID which, I assume, is a unique number that can be used in the SQL > Table? > > Rob
From: Geoff Schaller on 20 Jul 2008 18:48 Rob, You can auto-create GUIDs as Ginny suggests and they are guaranteed to be unique across the world. However, if it is something like an invoice or customer table where the number only has to be unique to that table, use an integer identity column. It is much smaller and simpler. The number is self-incrementing and doesn't require you to specify the field in the update statement. Geoff "Rob van Erk" <erk.v(a)hotmail.com> wrote in message news:1536e91e-6a1e-43ab-9d75-8eeee9e7fa95(a)s50g2000hsb.googlegroups.com: > Does the INSERT (SQL) statement create an unique record identifier and > how can I get that identifier using VO (Vo2Ado)? I read a lot in this > forum about defining unique record numbers (especial for DBF's) but > wonder if I have to follow same kind of procedures (as mentioned by > different visitors of this forum) when using SQL. What I want is to > ensure unique record numbers/identifiers are stored in my SQL DB, they > should not be visible for the user (so, exclude them from my bBrower) > and the contents of this "record identifier field" will be used when > updating records, etc. At least, that's is my perception of the > approach to be followed. > > What procedure is the best one to follow? I read something about > 'Select @@Identity' (which will give you the latest generated Id of > your connection) but think is not what I need. > > Any help is appreciated. > > Thks, > Rob
|
Next
|
Last
Pages: 1 2 3 Prev: Sql select - strange behavior Next: Vo2Ado - Excel (properties datetime to small) |