PRIMARY KEY required for WRITING to SQL DATABASE using DATA GRID?

G

Guest

I need an editable datagrid. But for editing a datagrid as shown in the
walkthrough: Using a DataGrid Web Control to Read and Write Data, the table
in the SQL database should have a primary key. But my table doesnt have one.
So what is the best way I can create primary key in SQL database?

Is UNIQUE IDENTIFIER a good option? Is it something like Auro Number of MS
Access which is automatically filled by the database for each row? If not ,
how can i make a primary key for that SQL table?
 
B

bruce barker

a UniqueIdentifiy in sqlserver is a GUID, not an autonumber. if you want an
autonumber add the identity constraint to an integer column.
UniqueIdentifiy has the advantage thet it can be assigned by sqlserver with
newid() function, or the caller.

-- bgruce (sqlwork.com)



| I need an editable datagrid. But for editing a datagrid as shown in the
| walkthrough: Using a DataGrid Web Control to Read and Write Data, the
table
| in the SQL database should have a primary key. But my table doesnt have
one.
| So what is the best way I can create primary key in SQL database?
|
| Is UNIQUE IDENTIFIER a good option? Is it something like Auro Number of MS
| Access which is automatically filled by the database for each row? If not
,
| how can i make a primary key for that SQL table?
| --
| pmud
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top