Click here to Skip to main content
15,922,584 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
below is my sql statement,my question
here when am not specifying any size its default getting (1)
and for numeric datatypes like int its having size 4
is for string datatypes is it mandatory specify size
i need to store char data which will be 10 characters is char default size is only 1

CREATE TABLE [dbo].finaltb(col1 char)
Posted
Updated 23-Jan-12 4:01am
v4

Try
SQL
CREATE TABLE [dbo].finaltb (col1 char(10))
 
Share this answer
 
CREATE TABLE [dbo].finaltb (col1 char(10))

Or else

CREATE TABLE [dbo].finaltb (col1 varchar(10))
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900