Hello all
I have a few questions and was hoping I could find answers here:
1- I just created a database and added a table called computers with ComputerID as the primary key; this field is also an identity, with seed = 1, and increment = 1. My problem is that, when I insert a new computer record (Processor, SN, etc.) using a
VB application I wrote, it allows me to have duplicate records, so I have 2 computers with the same values for all fields, including the primary key field, and it doesn't throw an exception or anything. From my little experience working with databases, I understand that a PK is unique automatically, is it not? How do I fix this?
2- This database I just created is supposed to work along side another database in the same server (the other database is the one used in Microsoft Small Business Accounting (SBA), if you care to know, but I am first testing all of this in one of the sample databases). In MY database, I created a View from a table in the sample database, and I am using this View to match Customers to Computers in a relation table. However, I realized that if I want to delete a customer, the computers for that customer won't be matched to any customer. Is there any way to fix this other than going into the sample database and modifying the PK referencing and deletion constraints for that Customers table?
3- This is my final question (for now anyway), after I am finished testing all of this on the sample database and have a solid database structure to work with along my company's database, I want to transfer MY database (the one with the computer table, the view and the relation table) to another server. I did some research and there is supposed to be some kind of wizard in SQL Server that helps you copy a database to another location, but I couldn't find it and, according to other forums, SQL Server 2005 doesn't come with this feature. How would I copy the database then?
Any help will be appreciated, and hopefully I didn't make this too long...I just wanted to be thorough.
Thanks
S.R.