AllInWorld99 provides a reference manual covering many aspects of web programming, including technologies such as HTML, XHTML, CSS, XML, JavaScript, PHP, ASP, SQL,FLASH, jQuery, java, for loop, switch case, if, if else, for...of, for...in, for...each,while loop, blogger tips, blogger meta tag generator, blogger tricks, blogger pagination, client side script, html code editor, javascript editor with instant output, css editor, online html editor, materialize css tutorial, materialize css dropdown list,break, continue statement, label,array, json, get day and month dropdown list using c# code, CSS button,protect cd or pendrive from virus, cordova, android example, html and css to make android app, html code play,telerik show hide column, Transparent image convertor, copy to clipboard using javascript without using any swf file, simple animation using css, SQL etc. AllInWorld99 presents thousands of code examples (accompanied with source code) which can be copied/downloaded independantly. By using the online editor provided,readers can edit the examples and execute the code experimentally.


     This is the very important and basics of sql server, we can create the table in two way. We can discuss it in the following.

Creating table method
1) Create table using query
2) Create table using options

The below steps are common to both types
1) Open Microsoft SQL server from start menu or icon.

Open Sql server

2) Enter your username and password to login (I am not set any username or password so I can login through windows username and password).

Connect sql server


Create table using query

syntax
create table table_name(col1 datatype(size),col2 datatype(size),etc...)
 After do that common steps, follow the steps
3) Select the database right click and select New Query, now display query window.

New Query in sql server

4) The query window will open and type type following example in the New Query window and press F5 to execute the command.

Example
create table student(name varchar(50),place varchar(20));

Execute sql query

5) The table was created successfully.

Create table using options
     After open and connect with sql server, you need to expand the database, find the Tables folder and right click and select New Table...


Creat table from right click


     In the newly opened window, you can give the column name and data type.

enter column and data type

   
     Finally click save or shortcut key ctrl+s to ask your table name, just enter the table name(student) and press ok to create a table with the name student.

sql table


Table created and now you can check your created table using select query.

select * from student

0 comments:

Post a Comment

Total Pageviews