Last post Aug 17, 2006 07:52 AM by Iori_Jay
Aug 15, 2006 02:56 PM|Kunalwqeic|LINK
I have created a table using VIEWS in SQL server 2005, now i want to be ablle to edit it in a datagrid but i cannot do so as i there is no primary key!
now does anybody know how to set a primary key constraint so i can set one of the fields as a primary key to identify the row?
Aug 16, 2006 09:39 AM|Iori_Jay|LINK
Aug 16, 2006 09:52 AM|Kunalwqeic|LINK
Is there any way in which i can state one of the columns to be a unique identifier? as i want to be able to edit my datagrid which is populating a VIEW table from SQL '05 but i cannot do so as i do not have a unique number to identify the row, even though
one of the columns in the table is a PK in its original table.
Aug 17, 2006 07:52 AM|Iori_Jay|LINK
If you just want a unique column to identify a row, newid() function is good for you[:)], which can be used in your CREATE VIEW statements:
create view v_test as
select o.OrderID, C.ContactName,newid() as ColID
from Orders o join Customers c