Skip to content

{ Category Archives } mssql

Importing the Geo-Names database into MsSql Server

Update (26-Jul-2009): This article is now a little outdated. The table now has some extra columns. Have a look at Loading GeoNames Data Into SQL Server 2008 by EdKatibah for an up-to-date approach. I’ve successfully imported the newest allCountries.txt with the following steps: UNIX2DOS to update the line endings of AllCountries.txt Same nant script below […]

Quick way to find space used by each table in a database

Found this very handy: sp_msforeachtable ‘sp_spaceused “?”‘ Produces a kind of ugly output (returns a table for each table). The original article includes a query to get all the results into one table: Quick way to find space used by each table in a database

Viewing the Locks in MS-SQL

select so.name, sli.*, sp.* from sysobjects as so join master..syslockinfo as sli on sli.rsc_objid = so.id join master..sysprocesses as sp on sp.spid = sli.req_spid where xtype = ‘U’ System tables reference: sysobjects syslockinfo sysprocesses