Hi Folks,
this may seem very lazy, but can someone exaplin this bit of code for me?
regID int IDENTITY(0,1)
It is part of an SQL CE command in a VB app, but I just don't get what the regID in IDENTITY (0,1) is in there for.
the full code is -
'Create SQL command to create the tblDetails table
-
-
Dim cmdTabla As New SqlCeCommand("CREATE TABLE tblDetails(regID int IDENTITY(0,1) PRIMARY KEY, Flower_ID NTEXT, Name_Eng NTEXT, Name_Lat NTEXT, Location_ID NTEXT, Habitat_ID NTEXT, Season_ID NTEXT, Family_ID NTEXT, Size NTEXT, Description NTEXT)", conn)
-
-
Sorry I havent trimmed the code for the window, don't really think it matters here.
5 1520
Hi. This statement is using CREATE TABLE and refers to one of the columns in the new table, tblDetails
regID int IDENTITY(0,1)
regID is the name of the column
int is the data type
IDENTITY means this is an autonumber or auto-increment field
(0,1) the zero is the seed or starting number. The one is the increment, i.e. each new record will increment by one.
regID is the name of the column
int is the data type
IDENTITY means this is an autonumber or auto-increment field
(0,1) the zero is the seed or starting number. The one is the increment, i.e. each new record will increment by one.
Hi, I understand the create etc.. However when I open the table in SQL Server CE the Reg "column" that it appears the code creates does not appear as a standard column, I created multiple tables and from what I gather the
CREATE TABLE **TABLENAME** (regID int IDENTITY(0,1) stays the same for each one. However it seems to produce different values for the Identity/reg in SQL viewer.
I am not even sure if this is important to my system design, I just like to understand all my code, and don't see why I am including this. Just wanted to know why it was there.
An identity column is not a standard column. You cannot update it. It is controlled by the database.
An identity column is not a standard column. You cannot update it. It is controlled by the database.
Ah so is it just one of those things thats there that you shouldn't ask about? It works .. so don't touch?
Ah so is it just one of those things thats there that you shouldn't ask about? It works .. so don't touch?
Not at all. You should understand the tools you're working with. It's just that in this case you are defining a field with parameters that indicate the database software should provide the values automatically, so you cannot update the field.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: J Allen Horner |
last post by:
I'm just starting to learn C, and the tutorial I'm reading uses this code as an
example:
-----------
#include <stdio.h>
#define MAX 10
int a;
int rand_seed=10;
|
by: MLH |
last post by:
A97 procedure to open http://www.arch.com/message/
enter an 800 number, press "Continue", enter a text msg
string from a memo field and press "Send"
This is a calendaring and appointment A97...
|
by: naheed javaid |
last post by:
I m student and doing my final project. My project is related to screen capturing.
my project captures screen and save the captured screen as bitmaps in a folder.
while the screen recording audio...
|
by: hassruby |
last post by:
Can someone pls help me with some validation that im having a few technical problems with in my program.
First of all, I will explain to you a little about what my program is suppose to do. It...
|
by: sathyakvani |
last post by:
hi al
i wrote a code (LOgin form) that checks the user id and if it exists validates the password but this is not all validating and simply displaying user does not exist
i am sending the code...
|
by: Ravi |
last post by:
#define JOIN(s1,s2) printf("%s = %s %s = %s",#s1,s1,#s2,s2)
|
by: parvtb |
last post by:
Thanks for your patience to read the entire post to understand my
confusion I have the user-defined class "tools":
class tools{
public:
tools( ......) {}
friend bool operator<...
|
by: Dave Young |
last post by:
I'm looking at some code that i've inherited and I'm not really familar with
what's going on here and was hoping somone could explain it to me.
For reference:
f1 is a long
f2 is a long
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |