Welcome Guest Search | Active Topics | Members | Log In | Register

SQL 2k store column value as Hex Options · View
WB
Posted: Wednesday, October 17, 2007 7:36:03 AM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 17/10/2007 07:36:03
Date: Wed, 17 Oct 2007 14:36:03 -0700

I want to store the Hex value of some color in a table. The table is a list
of classifications and their associated color ([sick, red], [lunch, blue],
etc.)

How should I store the hex value in the column? nvarchar is the data type I
have started with, but I wanted find out if there is something better?

WB


WB
Posted: Wednesday, October 17, 2007 8:17:45 AM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 17/10/2007 08:17:45
Date: Wed, 17 Oct 2007 15:17:45 -0700

would one column of varchar values be better than one column each for red,
green, blue?

WB

"Mohit K. Gupta" <mohitkgupta@msn.com> wrote in message
news:65C7D9A4-9A96-414E-A917-7F595E7645C5@microsoft.com...
> nvarchar is for Unicode characters. If you are just storing Hex values
like
> 00-FF? Then probably varchar is fine.
>
> --
> Mohit K. Gupta
> B.Sc. CS, Minor Japanese
> MCTS: SQL Server 2005
>
>
> "WB" wrote:
>
> > I want to store the Hex value of some color in a table. The table is a
list
> > of classifications and their associated color ([sick, red], [lunch,
blue],
> > etc.)
> >
> > How should I store the hex value in the column? nvarchar is the data
type I
> > have started with, but I wanted find out if there is something better?
> >
> > WB
> >
> >
> >


Tibor Karaszi
Posted: Thursday, October 18, 2007 10:29:14 AM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 18/10/2007 10:29:14
Date: Thu, 18 Oct 2007 08:29:14 +0200

I think another table would be the best thing. Your table has a foreign key to this and a row can
have any number of "color rows" associated with it.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi


"WB" <none> wrote in message news:O7PuhuQEIHA.1208@TK2MSFTNGP05.phx.gbl...
> would one column of varchar values be better than one column each for red,
> green, blue?
>
> WB
>
> "Mohit K. Gupta" <mohitkgupta@msn.com> wrote in message
> news:65C7D9A4-9A96-414E-A917-7F595E7645C5@microsoft.com...
>> nvarchar is for Unicode characters. If you are just storing Hex values
> like
>> 00-FF? Then probably varchar is fine.
>>
>> --
>> Mohit K. Gupta
>> B.Sc. CS, Minor Japanese
>> MCTS: SQL Server 2005
>>
>>
>> "WB" wrote:
>>
>> > I want to store the Hex value of some color in a table. The table is a
> list
>> > of classifications and their associated color ([sick, red], [lunch,
> blue],
>> > etc.)
>> >
>> > How should I store the hex value in the column? nvarchar is the data
> type I
>> > have started with, but I wanted find out if there is something better?
>> >
>> > WB
>> >
>> >
>> >
>
>


Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.1 (NET v2.0) - 9/10/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.045 seconds.