On xxx--main file
(
Name= ' xxxx ',
Fliename= ' Inside the path \xxxx.mdf ' that writes the file,
SIZE=XXMB,
FILEGROWTH=XXMB,
Maxsize=xxmb
)
Log on
(
Name= ' Xxxx_log ',
Filename= ' The path \XXXX_LOG.IDF ' inside the store,
SIZE=XMB,
filegrowth=xx%
)
Use MySchool
CREATE TABLE Class
(
Sid int Identity (primary key),
Sname Narchar (+) NOT NULL,
Sdesciootion nvarchar (512),
)
--Set the primary key that can be inserted into autogrow normally we don't do this.
SET Identity_insert Class off
--Add a new column to a known table
ALTER TABLE Class add Scount int NOT NULL
--Remove columns from the table
ALTER TABLE Class drop column Scount
--removing data from a table does not restore automatically added columns does not delete the table
Delete from Class where cid=3
--Delete the table directly
drop table Class
--delete Restores the automatically long columns
TRUNCATE TABLE Class
SQL database statements