By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,412 Members | 1,630 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,412 IT Pros & Developers. It's quick & easy.

sql create tables

100+
P: 229
Hi, I am just trying to set a sql database. I have this to create a table. I need to know two things.
1. I want the table to allow null. Anyone could tell me how I modify the null part. Is it just
AS NULL.
2. the other is as I am moving from an access database where I changed some fields from text to memo.
Is the [nvarchar] (25) part of that, and instead of declaring type of field you just declare its size, ie. (25) or (225) ?

[PDCustom14] [nvarchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
Thanks for any help.
Richard
Aug 28 '09 #1
Share this Question
Share on Google+
2 Replies


MrMancunian
Expert 100+
P: 569
Hi Richard,

If you want a column to allow null, don't do anything. If you don't want to accept null, use Not Null.

Nvarchar is a char with a maximum length of 255 characters. You use it as you said, use the parentheses to state the number of characters you want to use. If you want to use more than 255 character, you can use ntext.

Steven
Aug 28 '09 #2

100+
P: 229
Thank Stephen, really helpful.

I do have a doubt though I have
Expand|Select|Wrap|Line Numbers
  1. [PDPhoto] [image] NULL 
,

This null isnt, not null, but does it mean the same thing?
and the other thing I have read that [nvarchar] (max)
allows as much data as you want?
Thanks
Richard
Aug 28 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.