Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Update IP Location Column

Posted on October 10, 2013October 26, 2015 By David Kittell
UPDATE pageview
SET pageview.IPLocation = (
		SELECT TOP 1 (city + ', ' + region + ' ' + postalCode)
		FROM GeoCityLocation glcl
		INNER JOIN [GeoCityBlocks] glcb ON glcl.locId = glcb.locId
		WHERE (
				pageview.[ipint] BETWEEN startIpNum
					AND endIpNum
				)
			AND region = 'MI'
		)
WHERE url LIKE '%<URL>%'
	AND IPLocation IS NULL

See Page View Details and Get City/State/Country From IP

Originally Posted on October 10, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code MSSQL

Post navigation

Previous post
Next post

Related Posts

Excel Macro – Autofit width and height

Posted on January 26, 2015August 27, 2024

AutoFit() is designed to run in your Personal.xlsb with a keyboard function of Ctrl+d to select all columns and rows and then set a temporary width and height to then autofit based on all the content in the worksheet. Sub AutoFit() ‘ ‘ AutoFit Macro ‘ Resize the column width…

Read More

PowerShell – Disable Auto Run In Windows

Posted on April 8, 2016April 8, 2016

function Disable-AutoRun { $item = Get-Item ` "REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping\AutoRun.inf" ` -ErrorAction SilentlyContinue if (-not $item) { $item = New-Item "REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping\AutoRun.inf" } Set-ItemProperty $item.PSPath "(default)" "@SYS:DoesNotExist" } function Enable-AutoRun { Remove-Item "REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping\AutoRun.inf" -Force } Disable-AutoRun # Enable-AutoRun $path =’HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer’ Set-ItemProperty $path -Name NoDriveTypeAutorun -Type DWord -Value 0xFF Reference: http://stackoverflow.com/questions/14564380/how-to-disable-autorun-for-all-drives…

Read More

Product Key

Posted on November 17, 2014October 26, 2015

This function can be used for various tasks but I happen to use it to make product keys cleaner or easier to read. public static string sProductKey(string sRawText, int nLength) { string sFinal = ""; for (int i = 0; i <= sRawText.Length; i += nLength) { if (i +…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes