Skip to content

ErcanOPAK.com

  • ASP.Net WebForms
  • ASP.Net MVC
  • C#
  • SQL
  • MySQL
  • PHP
  • Devexpress
  • Reportviewer
  • About

Tag: identity

SQL

How to reset identity seed after deleting records in SQL

- 14.12.22 - ErcanOPAK comment on How to reset identity seed after deleting records in SQL

The DBCC CHECKIDENT management command is used to reset the identity counter. The command syntax is: DBCC CHECKIDENT (table_name [, { NORESEED | { RESEED [, new_reseed_value ]}}]) [ WITH NO_INFOMSGS ] Example: DBCC CHECKIDENT (‘[TestTable]’, RESEED, 0); IMPORTANT: The following example forces the current identity value in the AddressTypeID column in the AddressType table to a value […]

Read More
SQL

SQL Tip: “@@IDENTITY” should not be used

- 03.12.22 - ErcanOPAK comment on SQL Tip: “@@IDENTITY” should not be used

@@IDENTITY returns the last identity column value created on a connection, regardless of the scope. That means it could return the last identity value you produced, or it could return a value generated by a user-defined function or trigger, possibly one fired because of your insert. In order to access the last identity value created […]

Read More
SQL

Set Identity Insert On/Off in MSSQL

- 08.04.20 | 11.04.20 - ErcanOPAK comment on Set Identity Insert On/Off in MSSQL

SET IDENTITY_INSERT MyTable ON INSERT INTO MyTable (IdentityColumn, col2, col3, …) VALUES (IdentityValue, col2value, col3value, …) SET IDENTITY_INSERT MyTable OFF Note that you can not insert explicit value for identity column in table ‘MyTable’ when IDENTITY_INSERT is set to OFF.

Read More
SQL

Reset the Identity on table in MSSQL

- 08.04.20 - ErcanOPAK comment on Reset the Identity on table in MSSQL

DBCC CHECKIDENT(‘TableName’, RESEED, 0) Note that after running DBCC CHECKIDENT(‘TableName’, RESEED, 0): – Newly created tables will start with identity 0 – Existing tables will continue with identity 1

Read More
November 2023
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
« Oct    

Most Viewed Posts

  • Get the First and Last Word from a String or Sentence in SQL (694)
  • Get the User Name and Domain Name from an Email Address in SQL (691)
  • How to select distinct rows in a datatable in C# (550)
  • Add Constraint to SQL Table to ensure email contains @ (446)
  • Average of all values in a column that are not zero in SQL (366)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (336)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (333)
  • Find numbers with more than two decimal places in SQL (320)
  • Confirm before process with ASPxButton in Devexpress (313)
  • ASPxGridView – Disable CheckBox based on condition in GridViewCommandColumn (289)

Recent Posts

  • How to convert JPG or PNG to WebP in batch or single mode
  • How to get the first and the last day of previous month in SQL Server
  • Not Null check on LEFT function with T-SQL
  • NICE 100 YILLARA TÜRKİYEM
  • How to delete all commit history in github
  • How to display HTML components on the same line in CSS
  • How to insert results of a stored procedure into a temporary table
  • How to remove all non alphanumeric characters from a string in C#
  • How to get the Xth Day of the Week of the Year in C#
  • How to get formatted JSON in C#

Most Viewed Posts

  • Get the First and Last Word from a String or Sentence in SQL (694)
  • Get the User Name and Domain Name from an Email Address in SQL (691)
  • How to select distinct rows in a datatable in C# (550)
  • Add Constraint to SQL Table to ensure email contains @ (446)
  • Average of all values in a column that are not zero in SQL (366)

Recent Posts

  • How to convert JPG or PNG to WebP in batch or single mode
  • How to get the first and the last day of previous month in SQL Server
  • Not Null check on LEFT function with T-SQL
  • NICE 100 YILLARA TÜRKİYEM
  • How to delete all commit history in github

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter

© 2023 ErcanOPAK.com

Proudly powered by WordPress | Theme: Xblog Plus by wpthemespace.com