Click here to Skip to main content
       

Database

 
AnswerRe: SQL SERVER 2008 PinmemberJ4amieC6-Nov-12 4:31 
AnswerRe: SQL SERVER 2008 Pinmemberdjj556-Nov-12 5:43 
AnswerRe: SQL SERVER 2008 PinmemberMichael Potter6-Nov-12 5:47 
GeneralAwesome solution PinmemberDavid Mujica6-Nov-12 9:39 
Michael Potter wrote:
Make sure the Primary Key can only contain 1 value using a check constraint:

 
ALTER TABLE [dbo].[MyTable]  WITH CHECK ADD  CONSTRAINT [CK_OneRow] CHECK  (([Id]=(1)))

 
That is a very cool way to solve a very strange request. I'll give it a 5.
GeneralRe: Awesome solution PinmemberSrini Sydney14-Nov-12 12:24 
GeneralRe: SQL SERVER 2008 PinmemberMycroft Holmes6-Nov-12 13:11 
GeneralRe: SQL SERVER 2008 PinmemberMichael Potter7-Nov-12 6:23 
SuggestionRe: SQL SERVER 2008 PinmemberEddy Vluggen7-Nov-12 6:47 
GeneralRe: SQL SERVER 2008 PinmemberMichael Potter8-Nov-12 9:54 
GeneralRe: SQL SERVER 2008 PinmemberEddy Vluggen8-Nov-12 9:57 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 19 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid