Tag: SQL Server
Aggregate of columns, not rows
In SQL Server it is very easy to aggregate a value across many rows. You simply just write something like this: SELECT MAX(SomeColumn) FROM SomeTable This will...
DROP/CREATE vs ALTER on SQL Server Stored Procedures
We have a number of migration scripts that modify the database as our applications progress. As a result we have occasion to alter stored procedures, but...
Tip of the day: How to tell why your app couldn’t log on to SQL Server
When you get a log in failure on SQL Server the message you get back from SQL Server Management Studio, or in a .NET Exception is vague for security. They...
Optimising clustered indexes in SQL Server 2008
I've just found a script on another blog to go through all the clustered indexes in a SQL Server database and rebuild them in order to reduce fragmentation and...
If you really must do dynamic SQL...
I may have mentioned in previous posts and articles about SQL Injection Attacks that dynamic SQL (building SQL commands by concatenating strings together) is a...
Tip of the Day #5 (SQL Server memory usage)
You can limit the amount of memory that SQL Server uses by using the sp_configure stored procedure. By limiting the amount of memory that SQL Server is...
Spatial Operations in SQL Server 2008 (Katmai) - Union and Convex Hull
CODE EXAMPLES IN THIS POST WORK WITH THE NOVEMBER 2007 CTP (CTP 5) OF SQL SERVER 2008. Say you would like to create a polygon out of a group of points. One way...
Contradictory messages
While attempting to create a database project in Visual Studio 2008 against a SQL Server 2008 database I got a rather odd error message. The dialog used to...
Inserting geometry through a .NET Application
THIS POST REFERS TO THE NOVEMBER 2007 CTP (CTP 5) OF SQL SERVER 2008 Following from my previous posts ( Getting started with Spatial Data in SQL Server 2008 ,...
Getting started with Spatial Data in SQL Server 2008
THIS POST REFERS TO THE NOVEMBER 2007 CTP (CTP 5) OF SQL SERVER 2008 This post is probably going to be a wee bit random. After the running around over the last...
SQL Exception because of a timeout
You think it would be easy to find information on exactly what error number a SqlException has when the command timed out. But, it isn't. MSDN , for all that...
Oh No! More on SQL Injection Attacks
I've not written about this in a while becuase it seemed that people were getting the message. But today I was asked, on Code Project , "I am wondering why...
SQL Injection Attacks and executing dynamically created SQL
There is a very important difference between EXEC[UTE] and sp_executesql that anyone who executes dynamically generated SQL statements ought to know. Typically...
SQL Injection Attacks and Some Tips on How to Prevent Them
Introduction Security in software applications is an ever more important topic. In this article, I discuss various aspects of SQL Injection attacks, what to...
