You can now download SQL Server 2005 SP2 on Microsoft's website. Here's hoping that the install issues in SP1 won't plague SP2 as well!
I found this useful security tip on Microsoft.com. SAFE is the recommended permission setting for assemblies that perform computation and data management tasks without accessing resources outside an instance of SQL Server. We recommend using EXTERNAL_ACCESS for assemblies that access resources outside of an instance of …
Well, 10 steps, give or take. This could have been executed in fewer steps had we not chosen such a useful function as an example . This function, which is only supported in SQL Server 2005 with CLR enabled, essentially performs a reverse IP lookup (nslookup -type=ptr), uses System.Net.Dns.GetHostEntry and thus …
Here's some code that I'm posting mainly for my future reference. I do not recommend running this anywhere near a production machine. 1DECLARE @SQL varchar(8000) -- if you use nvarchar for whack table names, change this to 4000 2SET @SQL = '' 3 4SELECT @SQL = @SQL + 5 'ALTER DATABASE ' + NAME + ' …
As you probably know, Microsoft provides two undocumented/unsupported stored procedures for iterating through databases, sp_msforeachdb and sp_msforeachtable. I've always wondered, then, why the following code never showed up in Google searches: 1sp_MSforeachdb @command1 = 'EXEC sp_msForEachTable @COMMAND1= …
There are a few ways to do this but here's one that I like. I believe it works in SQL Server 7, 2000 and 2005. 1ALTER DATABASE myDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE 2GO 3USE myDatabaseName 4GO Go ahead and do what you need to do then set it back: 1ALTER DATABASE myDatabaseName SET MULTI_USER
This is more of a post for proper keywords. My previous entry titled "Import MaxMind City CSVs into SQL Server 2005" assumes the user has already conducted research to find that MaxMind's free GeoIP database provides the functionality to look up the location of an IP address. So, if you wish to quickly and …
I'd like to start this post by saying that BCP is limited and ghe-toe, but it gets the job done to some degree. One of the guys over at SQLteam.com wrote a really informative post on Flat File Bulk Import methods speed comparison in SQL Server 2005 that you should check out if you are into that sort of thing. BCP ranks …
Inspired by kitty0's GeoIP Demo (site no longer online), I created two scripts which automatically import the free MaxMind GeoIP City database (legacy) into SQL Server using VBS and BCP. The VBS file can be set as a Scheduled Task for MaxMind's free once-a-month updates. I also created a SQL Server UDF to access the …
This user-defined function (only available in SQL 2000 and above) is part of a larger project I'm working on. PARSENAME in SQL Server is my new favorite function.. Thanks to Jeff Smith for the heads up. 1CREATE FUNCTION [dbo].[IPtoNumeric] (@strIP varchar(255)) 2RETURNS bigint 3AS 4BEGIN 5 DECLARE @intIPNum bigint 6 IF …
Start typing to search
Search across posts, pages, and commands