Home
|
Tutorial
|
Articles
|
Forum
|
Interview Question
|
Code Snippets
|
News
|
Fun Zone
|
Poll
|
Web Links
|
Certification
|
Search
Welcome :
Guest
Sign In
Register
Win Surprise Gifts!!!
Congratulations!!!
Top 5 Contributors of the Month
satyapriyanayak
Narayanan
JQuery Developer
Karthikeyan Anbarasan
Amit Mehra
Home
>>
Forum
>>
Sql Server
>>
Post New Question
Subscribe to Forum
SQL Server 2008 - Table - Clarifications
Posted By:
Aarti
Posted Date:
October 17, 2009
Points:
2
Category :
Sql Server
Hi,
I am new to SQL Server 2008 database development.
Here I have a master table named 'Student' and a child table named 'Address'. The common column between these tables is 'Student ID'.
My doubts are:
> Do we need to put 'Address Id' in the 'Address' table and make it primary key? Is it mandatory?
( I won't be suing this 'Address Id' in any of my reports )
> Is Primary key column a must in any table?
Would you please help me on these.
Would you please also refer best links/tutorials for SQL Server 2008 database design practices (If you are aware of) which includes naming conventions, best practices, SQL optimizations etc. etc.
Thank you,
Regards.
Aarti.
Responses
Author:
Amit Mehra
Company URL:
http://www.dotnetspark.com
Posted Date: October 17, 2009 Points: 5
Hi Aarti,
Yes if the Child table is
Address
than you should put
Address Id
as a primary key.
No its not necessary to have primary key in all the tables but its best SQL Practices to have primary in in all the table. It will help to fetch the record faster because index is been created in the primary key column and foreign key column automatically.
I would also recommend you to have foreign key
Student Id
in
Address
Table.
Thanks
Amit
Thanks,
Amit
Please "
Mark As Answer
" if this post help you.
Post Reply
You must
Sign In
To post reply
Related Questions Related Questions
Table-Valued Parameters in Sql Server 2008
Sql SERVER 2008 ,automatice add all table of database this code what is problem plz suggest me
Get XML Data in datagridview from SQL SERVER Table
how to reset identity column value in a table in sql server
how to lock table in sql server
Latest Forum Questions From The Same Category
Split function for String in SQL Server
how to solve error in the storeprocedure
convert nvarchar sql server data type to number in ssis
while updating table...the old data should be save in another table
Updating Stored Procedure
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Here
Quick Links For Forum Categories:
ASP.Net
Windows Application
.NET Framework
C#
VB.Net
ADO.Net
Sql Server
SharePoint
OOPs
Silverlight
IIS
JQuery
JavaScript/VBScript
Biztalk
WPF
Patten/Practices
WCF
Others
www.DotNetSpark.com
UnAnswered
All
Hall of Fame
Twitter
Terms of Service
Privacy Policy
Contact Us
Archives
Tell A Friend