Easy SQL constraint question

Results 1 to 3 of 3

Thread: Easy SQL constraint question

  1. #1
    Join Date
    Dec 1969

    Default Easy SQL constraint question

    Hi,<BR><BR>I am trying to create an SQL message board. All is ok, except, the field constraints do not allow me to put very large texts into one field.<BR>I created the field like this:<BR>"create table "tablename"<BR>("column1" "data type" [constraint]);"<BR>It seems that a varchar datatype cannot be greater than (maybe) 30 characters. Is this an SQL problem (and if yes, what&#039;s the workaround) or just a limitation placed on my database by an administator?<BR>Any help would be appreciated.<BR><BR>Thank you,<BR>toni<BR>

  2. #2
    Join Date
    Dec 1969

    Default Why do you need more than a NOT NULL constraint.

    varchar and nvarchar can be several thousand bytes and text and ntext can hold considerably more.

  3. #3
    Join Date
    Dec 1969

    Default RE: Easy SQL constraint question

    In MS sql 7 "varchar" is good for up to 8000 chars.<BR>For text larger than that use a "Text" data type.<BR>I don&#039;t know why it would not let you create a larger varchar.<BR>Make sure your Create Table syntax is correct.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts