Langsung ke konten utama

Postingan

Menampilkan postingan dengan label SQL Server

SQL AUTO INCREMENT Field

AUTO INCREMENT Field Auto-increment allows a unique number to be generated automatically when a new record is inserted into a table. Often this is the primary key field that we would like to be created automatically every time a new record is inserted. Syntax for MySQL CREATE   TABLE  Persons (       ID int  NOT   NULL  AUTO_INCREMENT,     LastName varchar( 255 )  NOT   NULL ,     FirstName varchar( 255 ),     Age int,      PRIMARY   KEY  (ID) ); Syntax for SQL Server CREATE   TABLE  Persons (       ID int  IDENTITY ( 1 , 1 )  PRIMARY   KEY ,     LastName varchar( 255 )  NOT   NULL ,     FirstName varchar( 255 ),     Age int ); for Select Query SQL SERVER SELECT ROW_NUMBER () OVER ( ORDER BY FirstName, La...

How to enable mixed authentication in sql server

On the SQL Server start  SQL Server Management Studio   Enter the  Server name  and select  Windows authentication . Make sure you are logged in with administrator credentials.   Right click on the server name and select  properties   Go to  Security  and select  SQL Server and Windows Authentication Mode .   Right click on the server name and select  Restart  to restart the SQL services.