Category: SQL Server
-
SQL Server Spatial Data: Finding and Ordering Distance Between 2 Points
It’s pretty common to want to find the distance from a certain location to a location stored in your database. For example, in the Home Depot or Walmart website you might want to find the closest store. The locations of all of the stores will be stored in a database, and then given your location…
-
Removing Null Characters (0x00) From Values in SQL Server
I recently came across a problem while crawling a BCS data source in SharePoint 2010. Most of the 130,000 records were getting indexed, but I was getting an error on 25 records: Error while crawling LOB contents. ( ‘.’, hexadecimal value 0x00, is an invalid character. Line 25, position 10. ) When I first took…
-
Bulk Delete ASP.NET Membership Users
Below is a SQL script that can be used to delete a list of users from an ASP.NET membership database. It retrieves a list of users into a temporary table and then deletes the users from all the relevant tables in the database.
-
Use JPEG’s in Reporting Services if exporting to PDF
I recently made the mistake of using PNG’s for high-resolution background images in SQL Server Reporting Services (2008 R2). I wanted to use PNG’s as they were lossless, supported alpha transparency and actually generated smaller files than JPEG for the images I was using. Unfortunately I ran into these problems when exporting to PDF: SLOW…