Question : how to create tables in SQL Server 2008

I have created database and want to create database tables. I am confused about "SQL Server management Studio" and "Query Analyzer" of SQL Server 2008.

Answer : how to create tables in SQL Server 2008

Tables are very easy to create in SQL Server. First what you need to do is come up with your design. It is important to first establish what information you want to store in your database, and what information or reports you want to be produced from it. Once you know what fields you want to put in the table and what data type to use, it is pretty simple to create tables. You can create tables using SQL Server Graphical user interface (SQL Server Management Studio.)

If you successfully created a database, you can easily create tables by right clicking on the database you created and selecting "New Query." This will open a new query editor window, which will allow you to type in your SQL Statements. If you were creating a table to store automobile records, for example, you would create the table by writing the following sql statement

CREATE TABLE tblAutomobileData(
[ID] INT IDENTITY(1,1) NOT NULL,
[Manufacturer] VARCHAR(50),
[Model] VARCHAR(50),
[Cylinders] INT,
[HorsePower] INT,
[NumberOfSeats] INT,
[MilesPerGallon] FLOAT)

The script above will create a table called tblAutomobileData with the field names and data types indicated.
Random Solutions  
 
programming4us programming4us