After deleting lots of records from an sql server table, you may want to set the table’s primary key to 1 to a fresh start.
To do this, just execute the sql command below:
DBCC CHECKIDENT ('YourTableName', RESEED, 0)
Sometimes you may want to configure IIS not to listen all IP addresses. To do this:
Run regedit. Go to:
If the “ListenOnlyList” key does not exists, create a new multi-string value named “ListenOnlyList” (without quotes). Double click on it, and enter the IP addresses that you want to ISS to listen.
After that, run cmd. Run these commands:
net stop http (Y)
net start http
Here is the sample code:
CREATE PROCEDURE [dbo].[AddRecord]
— SET NOCOUNT ON added to prevent extra result sets from
— interfering with SELECT statements.
SET NOCOUNT ON;
DECLARE @InsertedID as int
INSERT INTO PKTable ( Column1, Column2 )
VALUES ( @Param1, @Param2 )
SELECT @InsertedID = @@IDENTITY
INSERT INTO FKTable ( ForeignKeyID )
VALUES ( @InsertedID )