Forums

This topic is locked

newbie SQL-SERVER 2000

Posted 12 Sep 2002 15:37:36
1
has voted
12 Sep 2002 15:37:36 Matthijs Horsman posted:
Hello all,

I have a simple newbie question for SQL-SERVER.

I used Acces as my database, but start using SQL now.

I am looking for the equivalents of
- autonumber (INT?)
- text
- memofield

And when should i use CHAR and when VARCHAR?

And maybe anybody knows how i can set my database to 7.0 ( i am using 2000 but my ISP can only handle 7.0 for now...)

Thnx in advance



Matthijs
----------------
DWMX/W-XP-PRO/IIS/ASP-VB
www.chaps.nl

Replies

Replied 12 Sep 2002 16:46:58
12 Sep 2002 16:46:58 Vince Baker replied:
The autonumber is:

Int (Interger) untick the allow nulls and select identity. You can set the identity seed to be whatever number you want to start on and the increment to be the number to increment by.

ie ID SEED = 5 and Increment = 2,

record ids will climb like 5,7,9,11 etc.

Use char when you want a defined length for a field (exact, if you enter less the field will be filled with blank spaces).

Use the varchar when the input in the field is undetermined (a name field for example) and with this you can set the maximum number of characters permitted.

If in doubt, use the varchar as you will have search issues later on if there are blank spaces in your records.

The text / memo are both char or varchar fields.

Regards
Vince

Response.write("The best line of code you can ever use"

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 12 Sep 2002 16:54:40
12 Sep 2002 16:54:40 Matthijs Horsman replied:
thnx... <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle><img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Matthijs
----------------
DWMX/W-XP-PRO/IIS/ASP-VB
www.chaps.nl

Reply to this topic