0 Comments

I had some "Weird" things happening with IIS on one of my developer machines. After trouble shooting for a while I decided that was definitely not winning and removed all features from my pc that were even the slightest related to IIS, my pc required a restart so I did. When it came back I re-enabled all the features as I would normally do and then attempted to put my dev site in IIS. For some reason all the sites were stopped and when trying to start them I received the message

---------------------------
Internet Information Services (IIS) Manager
---------------------------
The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020)
---------------------------
OK  
---------------------------

This was very weird as I was at this stage thinking that there shouldn't be anything running on port 80. I ran a Bing search and kb973094 - Error 0x80070020 when you try to start a Web site in IIS 7.0. Although I am using a later version of IIS I still gave it a read because most times things are similar or the same. In the resolution section it said I should run the below in Command Prompt

netstat -aon | find ":80"

With that I would get the output

image

and from there I needed to take the Process ID (Last Column) and look in Task Manager. When I opened Task Manager I noticed that the process that was using port 80 was Skype. After Ending the Skype process and doing an IIS Reset everything was back to normal.

I wanted to find out why Skype would be using port 80 and so I went into the settings and noticed a checkbox that was allowing it to use that port

image

After un-checking this box Skype has not taken control again =).

0 Comments

Your VSO Account

Ok so obviously the first you need is to have a VSO account. If you have one already, awesome, continue on and skip this section.

If not then you can get at http://www.visualstudio.com/. All you need to do is click on Sign up, fill in all of one field for what you want your account name to be and then click Create Account.

image

In less than a minute (exactly 11 seconds when making this post) you will see the page to create your first VSO Project for this account.

2015-01-16_21-16-42

Configuring Alternate Credentials

In the top right click on you name and then on the My profile link.

2015-01-16_21-21-29

When the dialog pops open you will need to click on the Credentials tab and then on Enable alternate credentials.

2015-01-16_21-22-58

At this point you can enter a secondary user name if you want and you will also use you will be required to enter a password and confirm that password and then click Save changes.

2015-01-16_21-25-35

This will allow you to connect to VSO using basic authentication.

Disabling Alternate Credentials

You can at any point come back to this dialog and click on Disable alternate credentials if you want to have alternate credentials enabled anymore.

2015-01-16_21-33-37

and then again click Save changes.

2015-01-16_21-34-30

Alternate credentials will now be disabled.

0 Comments

If you haven't heard yet Microsoft Virtual Academy are running "know it. Prove it". This is a great opportunity to learn something new or extend your current knowledge in one of the 8 topics available. 

 

2015-01-13_20-06-08

The Know it. Prove it. challenge is a month-long learning binge to accelerate your skills on the tech topic of your choice. Join the community, commit to the challenge, share your progress, and make February the month you perfect your tech chops.

Registration isn't open yet but you can sign up to be notified when it is.

2015-01-13_20-10-16

Time is ticking.

2015-01-13_20-03-08

What topic will you be rocking? #KnowItProveIt

0 Comments

This post has been ported from http://www.sqlservercentral.com/scripts/MS+SQL+2012/93043/ which I then repeated on https://gbeeming.wordpress.com/2013/02/12/failover-or-restart-results-in-reseed-of-identity-fix/.

There existed an "issue" for us when we moved to SQL 2012 where every time your SQL instance restarted for any reason be it manually or server unexpectedly turned off your identity columns would have jumped numbers on the next record being inserted. It was also raised on the connect site http://connect.microsoft.com/SQLServer/feedback/details/739013/alwayson-failover-results-in-reseed-of-identity.

We found out that this was not actually an issue and was by design for performance to optimize the amount of disk IOs that were required to generate sequence numbers. A post on SQL Server Training describes how to change the cache size http://www.sqlserver-training.com/sequence-breaks-gap-in-numbers-after-restart-sql-server-gap-between-numbers-after-restarting-server/-.

Before seeing that post however I developed another solution that basically reseeded every table on instance startup so the issue didn't exist. To use this solution you can just run the script below on your SQL instance.

USE master; 
GO
CREATE PROCEDURE sp_FixSeeds2012
AS
BEGIN

--foreach database
DECLARE @DatabaseName varchar(255)

DECLARE DatabasesCursor CURSOR READ_ONLY
FOR
SELECT name
FROM sys.databases
where name not in ('master','tempdb','model','msdb') and
sys.databases.state_desc = 'online'

OPEN DatabasesCursor

FETCH NEXT FROM DatabasesCursor
INTO @DatabaseName

WHILE @@FETCH_STATUS = 0
BEGIN

EXEC ('USE '+@DatabaseName + '

--foreach identity column
DECLARE @tableName varchar(255)
DECLARE @columnName varchar(255)
DECLARE @schemaName varchar(255)

DECLARE IdentityColumnCursor CURSOR READ_ONLY
FOR

select TABLE_NAME , COLUMN_NAME, TABLE_SCHEMA
from INFORMATION_SCHEMA.COLUMNS
where COLUMNPROPERTY(object_id(TABLE_NAME), COLUMN_NAME,
'
'IsIdentity'') = 1

OPEN IdentityColumnCursor

FETCH NEXT FROM IdentityColumnCursor
INTO @tableName, @columnName, @schemaName

WHILE @@FETCH_STATUS = 0
BEGIN

print '
'['+@DatabaseName+'].[''+@tableName+''].[''+
@schemaName+'
'].[''+@columnName+'']''
EXEC ('
'declare @MAX int = 0
select @MAX = max('
'+@columnName+'')
from ['
+@DatabaseName+'].[''+@schemaName+''].[''+@tableName+'']
if (@MAX IS NULL)
BEGIN
SET @MAX = 0
END
DBCC CHECKIDENT(['
+@DatabaseName+'.''+
@schemaName+'
'.''+@tableName+''],RESEED,@MAX)'')

FETCH NEXT FROM IdentityColumnCursor
INTO @tableName, @columnName, @schemaName

END

CLOSE IdentityColumnCursor
DEALLOCATE IdentityColumnCursor'
)

FETCH NEXT FROM DatabasesCursor
INTO @DatabaseName

END

CLOSE DatabasesCursor
DEALLOCATE DatabasesCursor
END
GO

EXEC sp_configure 'show advanced options', 1 ;
GO
RECONFIGURE
GO
EXEC sp_configure 'scan for startup procs', 1 ;
GO
RECONFIGURE
GO

EXEC sp_procoption @ProcName = 'sp_FixSeeds2012'
, @OptionName = 'startup'
, @OptionValue = 'true'
GO

Hope this helps someone as I see the connect issue on it is still active.