PrateekSaluja
PrateekSaluja

Reputation: 14926

How to store large string data into s SQL Server 2005 data base?

I have 100000 Ids to store into our DataBase. Id is in string format.each id contain 10 char. So what is the best data type is for this data?

I have been used vrchar(max), text but my problem is not solved.

So please experts help me.

Upvotes: 2

Views: 512

Answers (3)

gbn
gbn

Reputation: 432180

varchar(10) assuming you have one ID per row and upto 10 characters

All 100000 in one varchar(max) is simply wrong... or have I misunderstood your intention?

Upvotes: 0

Ray
Ray

Reputation: 21905

If each id is exactly 10 characters, then use a char(10) field

Upvotes: 1

davek
davek

Reputation: 22895

why not just varchar(10), if that is the max. length? that way you avoid any off-row storage. Although you'll need a good reason to store a numeric valued column in a non-numeric column...

Upvotes: 3

Related Questions