Click here to Skip to main content
16,005,037 members
Home / Discussions / Database
   

Database

 
QuestionSSRS: Justify TextBoxes Pin
Anderson Beppler28-Mar-13 7:52
Anderson Beppler28-Mar-13 7:52 
AnswerRe: SSRS: Justify TextBoxes Pin
thatraja4-Oct-13 20:36
professionalthatraja4-Oct-13 20:36 
QuestionMoving File Groups and Tables in SQL Server Pin
Ennis Ray Lynch, Jr.27-Mar-13 10:38
Ennis Ray Lynch, Jr.27-Mar-13 10:38 
AnswerRe: Moving File Groups and Tables in SQL Server Pin
Eddy Vluggen27-Mar-13 11:40
professionalEddy Vluggen27-Mar-13 11:40 
GeneralRe: Moving File Groups and Tables in SQL Server Pin
Ennis Ray Lynch, Jr.28-Mar-13 5:02
Ennis Ray Lynch, Jr.28-Mar-13 5:02 
AnswerRe: Moving File Groups and Tables in SQL Server Pin
Eddy Vluggen28-Mar-13 9:29
professionalEddy Vluggen28-Mar-13 9:29 
QuestionCreating column of type enum Pin
columbos1492727-Mar-13 6:02
columbos1492727-Mar-13 6:02 
AnswerRe: Creating column of type enum Pin
Eddy Vluggen27-Mar-13 8:07
professionalEddy Vluggen27-Mar-13 8:07 
Sql Server doesn't have an Enum datatype. You can store it's value-representation (int) or it's string-representation (varchar). It wouldn't do range-checking by default.

Simple example below on having range-checking by creating a table for the enum and referencing it;
SQL
CREATE TABLE enumEquipment([Label] VARCHAR(10) PRIMARY KEY)
 INSERT INTO enumEquipment (Label) VALUES ('Tank'), ('Suit'), ('Fins'), ('Mask'), ('Snorkel');

CREATE TABLE someTableUsingTheEnum
(
  Id INT IDENTITY(1,1) PRIMARY KEY,
  EnumValue VARCHAR(10) REFERENCES enumEquipment (Label)
)
 INSERT INTO someTableUsingTheEnum (EnumValue) VALUES ('Tank') -- works
 INSERT INTO someTableUsingTheEnum (EnumValue) VALUES ('Micky') -- fails
 
 SELECT * FROM someTableUsingTheEnum -- shows 1 record, with 'Tank'
 
DROP TABLE someTableUsingTheEnum
DROP TABLE enumEquipment
It'd be better, performance-wise, to use the integer-value of the enum. Just cast it to an int, and store it in an int in Sql Server.
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

AnswerRe: Creating column of type enum Pin
PIEBALDconsult27-Mar-13 8:27
mvePIEBALDconsult27-Mar-13 8:27 
AnswerRe: Creating column of type enum Pin
Jörgen Andersson27-Mar-13 8:38
professionalJörgen Andersson27-Mar-13 8:38 
GeneralRe: Creating column of type enum Pin
PIEBALDconsult27-Mar-13 12:00
mvePIEBALDconsult27-Mar-13 12:00 
GeneralRe: Creating column of type enum Pin
Jörgen Andersson27-Mar-13 21:07
professionalJörgen Andersson27-Mar-13 21:07 
GeneralRe: Creating column of type enum Pin
PIEBALDconsult28-Mar-13 4:18
mvePIEBALDconsult28-Mar-13 4:18 
GeneralRe: Creating column of type enum Pin
Jörgen Andersson28-Mar-13 4:56
professionalJörgen Andersson28-Mar-13 4:56 
QuestionGetting My Answers are Down voted many time … Pin
gvprabu26-Mar-13 18:58
gvprabu26-Mar-13 18:58 
AnswerRe: Getting My Answers are Down voted many time … Pin
Mycroft Holmes26-Mar-13 23:00
professionalMycroft Holmes26-Mar-13 23:00 
AnswerRe: Getting My Answers are Down voted many time … Pin
Richard MacCutchan27-Mar-13 4:02
mveRichard MacCutchan27-Mar-13 4:02 
Questionhow can a get top each event in my related table Pin
mhd.sbt26-Mar-13 7:07
mhd.sbt26-Mar-13 7:07 
AnswerRe: how can a get top each event in my related table Pin
Corporal Agarn26-Mar-13 8:57
professionalCorporal Agarn26-Mar-13 8:57 
GeneralRe: how can a get top each event in my related table Pin
mhd.sbt27-Mar-13 0:59
mhd.sbt27-Mar-13 0:59 
AnswerRe: how can a get top each event in my related table Pin
Mycroft Holmes26-Mar-13 13:08
professionalMycroft Holmes26-Mar-13 13:08 
AnswerRe: how can a get top each event in my related table Pin
EralperYilmaz1-Apr-13 1:20
EralperYilmaz1-Apr-13 1:20 
QuestionDatabase Deployment/Version updates in unison with source code Pin
dexterama26-Mar-13 6:55
professionaldexterama26-Mar-13 6:55 
AnswerRe: Database Deployment/Version updates in unison with source code Pin
Mycroft Holmes26-Mar-13 13:05
professionalMycroft Holmes26-Mar-13 13:05 
Questioncertain rows to column Pin
Richard.Berry10025-Mar-13 18:26
Richard.Berry10025-Mar-13 18:26 

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.