Click here to Skip to main content
15,895,667 members
Home / Discussions / Database
   

Database

 
GeneralRe: How to write this query? Pin
varshavmane8-Feb-09 4:35
varshavmane8-Feb-09 4:35 
GeneralRe: How to write this query? Pin
Blue_Boy8-Feb-09 8:50
Blue_Boy8-Feb-09 8:50 
QuestionUpdating Field Length of a Fields in Sql Server 2005 Pin
εїзεїзεїз7-Feb-09 20:36
εїзεїзεїз7-Feb-09 20:36 
AnswerRe: Updating Field Length of a Fields in Sql Server 2005 Pin
Mycroft Holmes8-Feb-09 16:56
professionalMycroft Holmes8-Feb-09 16:56 
GeneralRe: Updating Field Length of a Fields in Sql Server 2005 Pin
εїзεїзεїз8-Feb-09 21:34
εїзεїзεїз8-Feb-09 21:34 
GeneralRe: Updating Field Length of a Fields in Sql Server 2005 Pin
Mycroft Holmes8-Feb-09 21:53
professionalMycroft Holmes8-Feb-09 21:53 
GeneralRe: Updating Field Length of a Fields in Sql Server 2005 Pin
εїзεїзεїз8-Feb-09 22:00
εїзεїзεїз8-Feb-09 22:00 
QuestionSuggestion for Database model to store multiple value types Pin
Jani Giannoudis7-Feb-09 5:30
Jani Giannoudis7-Feb-09 5:30 
Based on some business objects, I need a database model to store generic property values.
The range of possible value types is known (no binary types).

What I already have:

CREATE TABLE ObjectOne
(
  Id   int,           -- primary key
  ...                 -- more fields
)
CREATE TABLE ObjectOneProperties
(
  ObjectOneId         int,   -- primary key, foreign key to the object one
  ObjectPropertiesId  int,   -- primary key, foreign key to the properties
)

CREATE TABLE ObjectTwo
(
  Id   int,           -- primary key
  ...                 -- more fields
)
CREATE TABLE ObjectTwoProperties
(
  ObjectTwoId         int,   -- primary key, foreign key to the object two
  ObjectPropertiesId  int,   -- primary key, foreign key to the properties
)

CREATE TABLE ObjectProperties
(
  Id              int,          -- primary key
  PropertyType    varchar(255)  -- property business type
  ???                           -- property value ? foreign key(s) ?
)

Until now, I have found two possible approaches:

Store value in one table
CREATE TABLE PropertyValues
(
  Id             int,          -- primary key
  ValueInt       int,          -- value as int
  ValueText      varchar(x),   -- value as text
  ValuedateTime  datetime,     -- value as datetime
  ...                          -- all other value types
)
Store value in multiple tables
CREATE TABLE PropertyIntValues
(
  Id       int,                -- primary key
  Value    int                 -- value as int
)
CREATE TABLE PropertyTextValues
(
  Id     int,                  -- primary key
  Value  varchar(x)            -- value as text
)
CREATE TABLE PropertyDateTimeValues
(
  Id     int,                  -- primary key
  Value  datetime              -- value as datetime
)
CREATE TABLE PropertyXxxxValues  -- for any other value types
(
  Id     int,                  -- primary key
  Value  xxx                   -- value as xxx
)
I have the following selection criteria:
- High performance is required
- Database neutral (if possible)
- Stored Procedures allowed
- No Triggers
- Storage amount is not critical

Any help, suggestion or alternative solution is greatly appreciated.

Cheers,
Jani [My Articles]

AnswerRe: Suggestion for Database model to store multiple value types Pin
Wendelius9-Feb-09 6:08
mentorWendelius9-Feb-09 6:08 
QuestionRe: Suggestion for Database model to store multiple value types Pin
Jani Giannoudis9-Feb-09 6:21
Jani Giannoudis9-Feb-09 6:21 
AnswerRe: Suggestion for Database model to store multiple value types Pin
Wendelius9-Feb-09 6:41
mentorWendelius9-Feb-09 6:41 
QuestionDelete Records Pin
Hemant Thaker7-Feb-09 0:59
Hemant Thaker7-Feb-09 0:59 
AnswerRe: Delete Records Pin
Vimalsoft(Pty) Ltd8-Feb-09 21:41
professionalVimalsoft(Pty) Ltd8-Feb-09 21:41 
Questionpasswords and varbinary in sql server... Pin
l a u r e n6-Feb-09 4:21
l a u r e n6-Feb-09 4:21 
AnswerRe: passwords and varbinary in sql server... Pin
Ennis Ray Lynch, Jr.6-Feb-09 7:23
Ennis Ray Lynch, Jr.6-Feb-09 7:23 
GeneralRe: passwords and varbinary in sql server... Pin
l a u r e n6-Feb-09 7:38
l a u r e n6-Feb-09 7:38 
GeneralRe: passwords and varbinary in sql server... Pin
Ennis Ray Lynch, Jr.6-Feb-09 7:42
Ennis Ray Lynch, Jr.6-Feb-09 7:42 
GeneralRe: passwords and varbinary in sql server... Pin
l a u r e n6-Feb-09 7:47
l a u r e n6-Feb-09 7:47 
QuestionMAX statement Pin
5fingers6-Feb-09 1:24
5fingers6-Feb-09 1:24 
AnswerRe: MAX statement Pin
Rupesh Kumar Swami6-Feb-09 1:36
Rupesh Kumar Swami6-Feb-09 1:36 
GeneralRe: MAX statement Pin
5fingers6-Feb-09 1:52
5fingers6-Feb-09 1:52 
AnswerRe: MAX statement Pin
l a u r e n6-Feb-09 4:41
l a u r e n6-Feb-09 4:41 
Questionhow to acess remote ms sql 2000 server Pin
schandrashekhar6-Feb-09 0:10
schandrashekhar6-Feb-09 0:10 
AnswerRe: how to acess remote ms sql 2000 server Pin
SeMartens6-Feb-09 1:34
SeMartens6-Feb-09 1:34 
QuestionReading from AS400 [modified] Pin
Giorgi Dalakishvili5-Feb-09 23:32
mentorGiorgi Dalakishvili5-Feb-09 23:32 

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.