Click here to Skip to main content
15,902,198 members
Home / Discussions / Database
   

Database

 
AnswerRe: Switch Case stmt! Pin
i.j.russell23-Mar-10 1:05
i.j.russell23-Mar-10 1:05 
AnswerRe: Switch Case stmt! Pin
Mschauder24-Mar-10 3:06
Mschauder24-Mar-10 3:06 
QuestionCalling procedure inside a procedure in sqlserver 2005 Pin
sumit703422-Mar-10 19:01
sumit703422-Mar-10 19:01 
AnswerRe: Calling procedure inside a procedure in sqlserver 2005 Pin
Mycroft Holmes22-Mar-10 20:12
professionalMycroft Holmes22-Mar-10 20:12 
QuestionAttempting to use Redemption and Powershell to import .msg files from a folder Pin
codekernel22-Mar-10 5:59
codekernel22-Mar-10 5:59 
AnswerRe: Attempting to use Redemption and Powershell to import .msg files from a folder Pin
i.j.russell22-Mar-10 6:19
i.j.russell22-Mar-10 6:19 
QuestionPrimary Key in SQL Server Table Variable Pin
John Gathogo22-Mar-10 2:44
John Gathogo22-Mar-10 2:44 
AnswerRe: Primary Key in SQL Server Table Variable Pin
Eddy Vluggen22-Mar-10 6:30
professionalEddy Vluggen22-Mar-10 6:30 
John Gathogo wrote:
Is there any benefit in setting a primary key in a table variable?

Yes, mainly to ensure referential integrity. That's probably an unsatisfying answer.

Imagine that your table only has "name" defined in it. We could add "John" as a record, and have a list of things that John should do in some other table. Might look like this;
SQL
TABLE Users (Name NVARCHAR(36))
"John"
"Peter"

TABLE Tasks (Name NVARCHAR(36), ThingToDo NVARCHAR(50))
"John", "Water the plants"
"John", "Cook dinner"
"Peter", "Write an article for CodeProject"

We're in trouble as soon as someone adds another user with the firstname "John"; we would no longer be able to differentiate between the tasks of the first "John" and the second "John". Now, it's a "best practice" to define a set of column-names that make a record unique. We could add the [Birthdate] of the user to the "Users" table, that way we could distingiush between the first and the second Johnny. It's easier[^] to just add a generated identity and to use that as a primary key.

A primary key is often accompanied by a clustered index. There's a heap of information on MSDN[^], if that is your kind of thing Smile | :)
I are Troll Suspicious | :suss:

QuestionSQLEXPRESS silent installation. Pin
Yosh_21-Mar-10 22:36
professionalYosh_21-Mar-10 22:36 
AnswerRe: SQLEXPRESS silent installation. Pin
Steven J Jowett24-Mar-10 1:33
Steven J Jowett24-Mar-10 1:33 
GeneralRe: SQLEXPRESS silent installation. Pin
Yosh_5-Apr-10 23:53
professionalYosh_5-Apr-10 23:53 
QuestionHow to connect remote sql server(within LAN) using ADO? Pin
kcynic21-Mar-10 17:16
kcynic21-Mar-10 17:16 
AnswerRe: How to connect remote sql server(within LAN) using ADO? Pin
Mycroft Holmes21-Mar-10 20:38
professionalMycroft Holmes21-Mar-10 20:38 
GeneralRe: How to connect remote sql server(within LAN) using ADO? Pin
kcynic21-Mar-10 20:41
kcynic21-Mar-10 20:41 
GeneralRe: How to connect remote sql server(within LAN) using ADO? Pin
Mycroft Holmes21-Mar-10 20:48
professionalMycroft Holmes21-Mar-10 20:48 
GeneralRe: How to connect remote sql server(within LAN) using ADO? Pin
kcynic21-Mar-10 20:55
kcynic21-Mar-10 20:55 
GeneralRe: How to connect remote sql server(within LAN) using ADO? Pin
Mycroft Holmes21-Mar-10 21:02
professionalMycroft Holmes21-Mar-10 21:02 
GeneralRe: How to connect remote sql server(within LAN) using ADO? Pin
kcynic21-Mar-10 21:15
kcynic21-Mar-10 21:15 
GeneralRe: How to connect remote sql server(within LAN) using ADO? Pin
Mycroft Holmes22-Mar-10 0:18
professionalMycroft Holmes22-Mar-10 0:18 
GeneralRe: How to connect remote sql server(within LAN) using ADO? Pin
kcynic22-Mar-10 1:38
kcynic22-Mar-10 1:38 
AnswerRe: How to connect remote sql server(within LAN) using ADO? Pin
T210224-Mar-10 19:23
T210224-Mar-10 19:23 
GeneralRe: How to connect remote sql server(within LAN) using ADO? Pin
kcynic25-Mar-10 15:31
kcynic25-Mar-10 15:31 
AnswerRe: How to connect remote sql server(within LAN) using ADO? Pin
Аslam Iqbal26-Mar-10 10:15
professionalАslam Iqbal26-Mar-10 10:15 
GeneralRe: How to connect remote sql server(within LAN) using ADO? Pin
Elangovan Ayyandurai19-Dec-10 19:34
Elangovan Ayyandurai19-Dec-10 19:34 
Questioni luv forums... Pin
Mike65432121-Mar-10 17:00
Mike65432121-Mar-10 17:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.