How To Auto Increment Column Microsoft SQL Database Using Microsoft SQL Server Management Studio

How To Auto Increment Column Microsoft SQL Database Using Microsoft SQL Server Management Studio

SQL QUERY

Microsoft SQL Server Management Studio Screenshots

MICROSOFT SQL CODE


USE [Staff]
GO

/****** Object:  Table [dbo].[Newstaff]    Script Date: 6/3/2021 3:50:18 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Newstaff](
	[SID] [int] IDENTITY(1,1) NOT NULL,
	[Fname] [varchar](150) NOT NULL,
	[lname] [varchar](150) NOT NULL,
	[gender] [varchar](20) NOT NULL,
	[dob] [varchar](100) NOT NULL,
	[mobile] [bigint] NOT NULL,
	[email] [varchar](150) NULL,
	[joindate] [varchar](100) NOT NULL,
	[city] [varchar](100) NOT NULL,
	[basicSalary] [decimal](8, 2) NULL,
	[post] [varchar](max) NULL,
 CONSTRAINT [PK_Newstaff] PRIMARY KEY CLUSTERED 
(
	[SID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO


SOFTWARES

  1. Microsoft SQL Server Management Studio

VIDEO TUTORIAL

Leave a Reply

Your email address will not be published. Required fields are marked *