Hi, currently I am doing an online store web application. I am trying to do a delete record w/o the use of primary key.
In Ms sql server 2008 database, it contains all these fields: itemName, itemDesc, category, catID(FK).
itemName itemDesc category catID(FK)
dress Dress with flowers at the side Floral 1
Skirt Skirt with flower petals Floral 1
Becky Bloomwood110 reputationPosted Feb 7, 2011, 11:48 PM EST
0
I tried to make use of FK but cant and it seems that FK is the only option that I can use. What if I make use of itemName, how do I declare it?
Thks:)You guys have been so helpful.Appreciate it alot.
0
Krishna GaradRank #191 · 12.8K reputationPosted Feb 8, 2011, 12:15 AM EST
0
In this you can create one productid field which is primary key and on the basis of this product id you can selete unique record. If you tryed to delete on the basis of CatId field it will delete all the product under same category. That's better user ProductId field as primary key.
Jean PaulRank #32 · 38.5K reputationPosted Feb 7, 2011, 11:37 PM EST
1) Use the data to get correct id and use id to delete the record
or
2) Get the row number of the record and use that for deletion
http://www.dbforums.com/db2/1625506-sql0158n-during-delete-row_number.html
Becky Bloomwood110 reputationPosted Feb 7, 2011, 11:48 PM EST
Thks:)You guys have been so helpful.Appreciate it alot.
Krishna GaradRank #191 · 12.8K reputationPosted Feb 8, 2011, 12:15 AM EST
Becky Bloomwood110 reputationPosted Feb 8, 2011, 2:33 AM EST