Excel search from right to left


Function RevInStr(findin As Range, tofind As String) As Integer

' Chris Rae's VBA Code Archive - http://chrisrae.com/vba

Dim findcha As Integer

For findcha = Len(findin) - Len(tofind) + 1 To 1 Step -1

If Mid(findin, findcha, Len(tofind)) = tofind Then

RevInStr = findcha

Exit Function

End If

Next findcha

' Defaults to zero anyway (tsk, tsk, etc)

End Function

How to: change SQL server instance name

SQL server typically gets its instance name from underlining machine name when the SQL server was first installed. If the machine name has been changed, the SQL server instance name will be in-sync with network name. It could cause lots of wired behavior. If the following two command give you different name, then you better change your instance name.
sp_helpserver
select @@servername

To change instance name run this:

sp_dropserver 'old_name'
go
sp_addserver 'new_name','local'
go

Then restart the SQL server service.