SQL Server Create Table – Learn how to create table using SQL Server Management Studio and also use of important data types. At the very being digital data store as the only file system. But now time to time improve the technology and store database as Relational Database System.
To increase the performance to read and write of data the technology use some techniques like indexing, organised data structure. So In this tutorial, we discuss those things related to Database Table.
Table of Contents
- What is Table in Database?
- Create Table in SQL Server Management Studio.
- Write a script to create Table in SQL Server.
- Data Types in SQL Server.
What is Table in Database?
In case of Database, the Table is a structure of data. Database management system store data as a two-dimensional table format. So the table is a pre define structure where we can insert data and fetch data when needed.
The table has multiple columns to store different types of data. So in the table, you need to define columns with a particulars data type.
Create Table in SQL Server Management Studio.
The SQL Server Management Studio is a very user-friendly tool to manage MS SQL Database. Before start create a table you should have knowledge about Data Type, Primary Key, Foreign Key length of data type etc.
After connecting with SQL Server Management Studio and creation of Database create the table. Follow the following steps to create a table in database.

Expand the database where you want to create the table the Right Click on “Tables” then click on “Table“. You will get a Table Creation window. In the table creation window three columns available.
- Column Name
- Data Type
- Allow Nulls
Column Name
This is for the name of a unique column of your table. The column name of a table should be unique. Try to use data relevant column name. For example, if you want to store Id, Name, Age and DOB of a particular person. Then try to keep the column name of the table is “Id”, “Name”, “Age” and “DOB” respectively.
Data Type
In case of Table creation, the Data Type is very important. When you will create a table, should mention the type of data. It helps you to prevent invalid input.
For example, if you want to store an integer value then you need to set data type “int” or “biting”. similarly for store string value use “varchar” datatype. We will discuss the details of some important data types below. Now we create a table with some sample columns.
Allow Nulls
This option is for allowing “NULL” value therefore set this option “True” the value of this column can be “NULL” otherwise not.

Add column name with the appropriate data type. Please see the above screenshot. After entering all fields save the table. To save the table press [CTRL]+S and type the name of the table.
Write a script to create Table in SQL Server.
You can also write a script to create a table in SQL Server. We will use SQL Server Management Studio to run the script. See the syntax for Creation a Table in SQL Server.
CREATE TABLE
{ database_name.schema_name.table_name | schema_name.table_name | table_name }
( { <column_definition> } [ ,...n ] )
[ ; ]
Simplify form of the above syntax
CREATE TABLE [NAME OF TABLE]
(
[COLUMN NAME 1] DATATYPE PRIMARY KEY
,[COLUMN NAME 2] DATATYPE NOT NULL
,[COLUMN NAME 3] DATATYPE
)
To create a table follow the step by step process.
Step 1: Open New Query window in SQL Server Management Studio – To open the “Query Window” press [CTRL]+N or click on “New Query” option from Management Studio tool.
Step 2: Type the script to create a Table – For example hare we create a table, the name of the table is “MyTable” with sample three column. The script is below.
CREATE TABLE MyTable
(
Id INT PRIMARY KEY
,Name VARCHAR(200) NOT NULL
,Age INT
,DOB DATE
)
Step 3: Click on “Execute” option or press the “F5” button to execute the script. Your table will create with the name.
Data Types in SQL Server
In the case of table creation, you can use so many data types in SQL Server as per your requirement. Data Types in SQL Server divided into seven different categories. The categories are below.
Categories of Data Types
- Exact numerics
- Approximate numerics
- Date and time
- Character strings
- Unicode character strings
- Binary strings
- Other data types
Importance of Data Types
Being a good database design you should always remember so many things like data validation, use of perfect data type and space of the database. For example, you need to store a numeric value then you should be the use of the data types under Exact numerics.
Another example of the use of data type. Suppose you need to store some data of an employee like is “Age”, “EmployeeNo” and “Salary” then you need to use three different types of data type.
Though “Age” and “EmployeeNo” both are numeric type but you need to use “tinyint” data type for age and “int” for “EmployeeNo”. Because “tinyint” can store maximum 255 and the age of any employee can not greater than 255 but EmployeeNo can greater than 255. Therefore in the case of “EmployeeNo” use “int” data type. For salary, you can use “money” data type
As “int” data type takes 4 bites of data where “tinyint” takes 1 bite of data. So you can save 3 bites of data in case of age. So to design best database carefully choose the data types.
Exact numerics
In this Data Type, you can store numeric value only, Choose this data types depend on your requirement.
- bigint – 8 bites of storage required to store.
- bit – bit can store 1-bit data, the “True” converted to 1 and “False” converted to 0
- decimal – Storase depend on precision
- int– 4 Bytes
- money – 8 Bytes
- numeric– Same as decimal storage depend on Precision
- smallint– 2 Bytes
- smallmoney– 4 Bytes
- tinyint– 1 Byte
Approximate numerics
- float – Depend on n value like. 1-24 4 Bytes 25-53 8 Bytes
- real – 4 Bytes
Date and time
- date
- time
- datetime
- datetime2
- datetimeoffset
- smalldatetime
Character strings
- char
- varchar
- text
Unicode character strings
- nchar
- nvarchar
- ntext
Binary strings
- binary
- varbinary
- image
Other data types
- cursor
- rowversion
- hierarchyid
- uniqueidentifier
- sql_variant
- xml
- Spatial Geometry Types
- Spatial Geography Types
- table

An attention-grabbing discussion is price comment. I feel that you need to write more on this subject, it might not be a taboo topic but generally individuals are not sufficient to talk on such topics. To the next. Cheers
Thanks for your write-up. Another thing is that just being a photographer includes not only problem in catching award-winning photographs but also hardships in establishing the best dslr camera suited to your needs and most especially hardships in maintaining the grade of your camera. This really is very true and obvious for those photography enthusiasts that are into capturing this nature’s eye-catching scenes – the mountains, the particular forests, the actual wild and the seas. Going to these adventurous places surely requires a camera that can meet the wild’s hard environments.
Does your site have a contact page? I’m having trouble locating it but, I’d like to shoot you an e-mail. I’ve got some suggestions for your blog you might be interested in hearing. Either way, great site and I look forward to seeing it expand over time.
I have acquired some new elements from your web page about computer systems. Another thing I have always thought is that laptop computers have become an item that each home must have for many people reasons. They supply you with convenient ways to organize the home, pay bills, go shopping, study, focus on music and perhaps watch tv series. An innovative strategy to complete these tasks is with a notebook. These pcs are mobile ones, small, strong and lightweight.
I like the helpful information you supply to your articles. I?ll bookmark your blog and take a look at once more here regularly. I am moderately certain I?ll be told many new stuff proper here! Good luck for the following!
We’re a group of volunteers and opening a brand new scheme in our community. Your web site offered us with valuable information to paintings on. You’ve done a formidable task and our whole neighborhood might be grateful to you.
Thanks for any other informative site. The place else could I am getting that kind of information written in such a perfect way? I have a undertaking that I am just now operating on, and I’ve been on the glance out for such info.
Once I originally commented I clicked the -Notify me when new comments are added- checkbox and now each time a remark is added I get four emails with the identical comment. Is there any way you can remove me from that service? Thanks!
Hello, i think that i saw you visited my web site thus i came to ?return the favor?.I am trying to find things to enhance my web site!I suppose its ok to use some of your ideas!!
Yet another thing is that when searching for a good on the net electronics retail outlet, look for web stores that are regularly updated, trying to keep up-to-date with the most recent products, the best deals, along with helpful information on services. This will make certain you are getting through a shop that really stays over the competition and provide you things to make intelligent, well-informed electronics acquisitions. Thanks for the critical tips I’ve learned through your blog.
Woah! I’m really enjoying the template/theme of this blog. It’s simple, yet effective. A lot of times it’s tough to get that “perfect balance” between superb usability and appearance. I must say you have done a very good job with this. Additionally, the blog loads extremely fast for me on Internet explorer. Exceptional Blog!
Please let me know if you’re looking for a writer for your blog. You have some really good articles and I believe I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some content for your blog in exchange for a link back to mine. Please blast me an e-mail if interested. Thanks!
I would also like to state that most individuals who find themselves with out health insurance usually are students, self-employed and people who are out of work. More than half from the uninsured are under the age of Thirty-five. They do not really feel they are looking for health insurance because they are young plus healthy. Their particular income is frequently spent on houses, food, plus entertainment. Most people that do go to work either complete or part-time are not supplied insurance by means of their work so they move without because of the rising tariff of health insurance in america. Thanks for the concepts you write about through your blog.
Thanks for these pointers. One thing I should also believe is that often credit cards giving a 0 interest often attract consumers in zero interest rate, instant acceptance and easy on the web balance transfers, nevertheless beware of the main factor that will void the 0 easy neighborhood annual percentage rate and as well as throw one out into the poor house quickly.
One thing I’d like to say is the fact before acquiring more computer system memory, look into the machine directly into which it can be installed. If the machine is actually running Windows XP, for instance, the actual memory ceiling is 3.25GB. Adding a lot more than this would merely constitute a new waste. Make sure that one’s motherboard can handle this upgrade quantity, as well. Great blog post.
This is hands down one of the best articles I’ve read on this topic! The author’s comprehensive knowledge and zeal for the subject shine through in every paragraph. I’m so appreciative for coming across this piece as it has deepened my comprehension and sparked my curiosity even further. Thank you, author, for investing the time to create such a phenomenal article!
Helpful info. Fortunate me I discovered your web site by accident, and I’m stunned why this accident did not happened in advance! I bookmarked it.
Do you mind if I quote a few of your posts as long as I provide credit and sources back to your website? My website is in the very same area of interest as yours and my users would really benefit from some of the information you present here. Please let me know if this alright with you. Thanks a lot!
Nice read, I just passed this onto a colleague who was doing some research on that. And he just bought me lunch as I found it for him smile So let me rephrase that: Thank you for lunch!
very nice publish, i definitely love this web site, carry on it
Thanks for your useful post. Over time, I have come to understand that the actual symptoms of mesothelioma cancer are caused by the build up connected fluid relating to the lining of the lung and the upper body cavity. The sickness may start while in the chest place and multiply to other areas of the body. Other symptoms of pleural mesothelioma cancer include weight reduction, severe deep breathing trouble, fever, difficulty swallowing, and puffiness of the face and neck areas. It must be noted that some people having the disease never experience any kind of serious indications at all.
Great ? I should certainly pronounce, impressed with your web site. I had no trouble navigating through all the tabs as well as related info ended up being truly simple to do to access. I recently found what I hoped for before you know it in the least. Reasonably unusual. Is likely to appreciate it for those who add forums or anything, website theme . a tones way for your customer to communicate. Excellent task..
I think that is one of the such a lot significant info for me. And i am satisfied studying your article. But want to commentary on some general things, The website taste is perfect, the articles is in reality excellent : D. Excellent job, cheers
There are some attention-grabbing points in time on this article however I don?t know if I see all of them center to heart. There’s some validity however I will take maintain opinion until I look into it further. Good article , thanks and we would like more! Added to FeedBurner as well
Thanks for these pointers. One thing I should also believe is that often credit cards presenting a 0 apr often entice consumers with zero interest rate, instant acceptance and easy on the net balance transfers, however beware of the real factor that may void your 0 easy street annual percentage rate and also throw anybody out into the bad house rapid.
Thanks for your post. I’d like to comment that the price of car insurance varies greatly from one insurance policy to another, since there are so many different issues which play a role in the overall cost. For instance, the make and model of the motor vehicle will have a tremendous bearing on the fee. A reliable old family motor vehicle will have a more economical premium when compared to a flashy racecar.
Whats up are using WordPress for your blog platform? I’m new to the blog world but I’m trying to get started and create my own. Do you need any html coding expertise to make your own blog? Any help would be really appreciated!
Hello my family member! I wish to say that this article is awesome, great written and come with almost all significant infos. I would like to peer extra posts like this .
Spot on with this write-up, I actually suppose this website wants much more consideration. I?ll in all probability be again to read rather more, thanks for that info.
I’d like to thank you for the efforts you have put in writing this website. I’m hoping to view the same high-grade blog posts from you later on as well. In truth, your creative writing abilities has motivated me to get my own blog now 😉
Good post. I learn one thing more challenging on different blogs everyday. It’ll all the time be stimulating to learn content material from different writers and apply a bit one thing from their store. I?d desire to use some with the content on my blog whether you don?t mind. Natually I?ll give you a hyperlink on your internet blog. Thanks for sharing.
Good article and right to the point. I am not sure if this is truly the best place to ask but do you guys have any ideea where to employ some professional writers? Thx 🙂
I’m truly enjoying the design and layout of your blog. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a designer to create your theme? Outstanding work!
I have read so many articles concerning the blogger lovers
but this piece of writing is really a nice post, keep it up.
Greetings I am so delighted I found your webpage, I really found you by mistake, while I was looking on Askjeeve for something else, Regardless I am here now and would just like to say kudos for a incredible post and a all round thrilling blog (I also love the theme/design), I don’t have time to read it all at the minute but I have saved it and also included your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the great work.
Great goods from you, man. I’ve understand your stuff previous to and you’re just too wonderful. I actually like what you’ve acquired here, really like what you’re saying and the way in which you say it. You make it enjoyable and you still take care of to keep it smart. I can’t wait to read far more from you. This is really a great web site.
Hmm it looks like your website ate my first comment (it was super long) so I guess I’ll just sum it up what I wrote and say, I’m thoroughly enjoying your blog. I as well am an aspiring blog blogger but I’m still new to the whole thing. Do you have any suggestions for first-time blog writers? I’d really appreciate it.
Some really superb info , Gladiola I observed this.
You can certainly see your enthusiasm in the work you write. The world hopes for more passionate writers like you who are not afraid to say how they believe. Always follow your heart.