T-SQL Examples
SET IDENTITY_INSERT
set identity_insert dbo.TableName on
--Insert your record(s) with the values you want in the IDENTITY column
set identity_insert dbo.TableName off
DBCC CHECKIDENT
dbcc checkident ( 'dbo.TableName', noreseed ); --see what the current seed value is
dbcc checkident( 'dbo.TableName', reseed, 30 ); --reseed the value to 30, next record inserted will be 31
row_number()
select
, row_number() over( partition by ol.OrderID order by ol.TaxSalesPercent desc ) as OrderLineRowNumber
from ...
xp_cmdshell
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO
SQL Server Version Infomation
select
serverproperty('productversion') as ProductVersion,
serverproperty('productlevel') as ProductLevel,
serverproperty('edition') as Edition,
@@version as FullVersionText
set identity_insert dbo.TableName on
--Insert your record(s) with the values you want in the IDENTITY column
set identity_insert dbo.TableName off
DBCC CHECKIDENT
dbcc checkident ( 'dbo.TableName', noreseed ); --see what the current seed value is
dbcc checkident( 'dbo.TableName', reseed, 30 ); --reseed the value to 30, next record inserted will be 31
row_number()
select
, row_number() over( partition by ol.OrderID order by ol.TaxSalesPercent desc ) as OrderLineRowNumber
from ...
xp_cmdshell
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO
SQL Server Version Infomation
select
serverproperty('productversion') as ProductVersion,
serverproperty('productlevel') as ProductLevel,
serverproperty('edition') as Edition,
@@version as FullVersionText