Use this example to see the core idea, then work through the complete steps below. Code snippets are Classic ASP / VBScript or SQL Server T-SQL as labelled, not PHP.
SQL example
CREATE TABLE dbo.student (
id INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
name VARCHAR(50) NOT NULL,
class VARCHAR(20) NOT NULL,
mark INT NOT NULL,
sex VARCHAR(20) NULL
);Run the DDL once in a development SQL Server database. The related SELECT tutorial uses the same dbo.student columns.
The historical version of this page showed SQL Server Enterprise Manager. That interface is obsolete, but the underlying task—creating a table—is still fundamental. Current SQL Server installations are commonly administered with SQL Server Management Studio (SSMS), Azure Data Studio replacements/tooling, or SQL scripts.
CREATE TABLE dbo.student (
id INT IDENTITY(1,1) NOT NULL CONSTRAINT PK_student PRIMARY KEY,
name VARCHAR(50) NOT NULL,
class VARCHAR(20) NOT NULL,
mark INT NOT NULL,
sex VARCHAR(20) NULL
);
An IDENTITY column can generate numeric keys, while the primary-key constraint enforces uniqueness. Choose column lengths and nullability from the real data requirements rather than copying old sample widths.
The screenshot below is retained only to document the older Enterprise Manager workflow. Do not expect the current SQL Server management interface to match it.
All SQL Server student-table examples in this cluster use dbo.student and columns id, name, class, mark, and sex. Create the table in a test database before running the query examples.
CREATE TABLE changes database structure. Run it once in a development database rather than automatically executing schema changes in public-facing ASP requests.
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.