Tag Archives: sql

Remove Characters in String T-SQL with No Loop Part 2

Okay, expanding on what I did yesterday. I Built a table, called ExclusionList with one field, ExcludedText E.g. Then created a function: You can then use like this:

Posted in Programming | Tagged , , , , | Leave a comment

Remove Characters in String T-SQL with No Loop

Ok, I’ve seen many ways to do this using loops, but nothing in plain T-SQL Let’s say we have a string that may contain illegal characters, in my case it was project identifiers that needed to be used as file … Continue reading

Posted in Programming | Tagged , , , , , , | Leave a comment

Loading Data into a DataReader and Looping Through Records OLEDB / C#

Just a quick example of loading data into a data reader using C#. My data source is MS SQL Server in this case, although you would just need the correct OLEDB connection string to use any other data source. Couple … Continue reading

Posted in Programming | Tagged , , , , , | Leave a comment

Search for Value in Multiple Columns SQL Server T-SQL

Having to write some SQL SELECT’s on some un-normalized tables left me thinking there has to be a tidier way. I started with: (@SCAN_ID is a variable declared earlier) I ended up with: Maybe not a massive improvement, but personally … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Browse for SQL Server 2008 R2 Installation Media

When running the SQL Server Installation Centre I was receiving the above error. This seems to be caused by the software being installed to a temp folder which is subsequently deleted post install. Mine had been installed from a folder … Continue reading

Posted in Programming | Tagged , , | 2 Comments

Multiple OR’s in T-SQL WHERE Condition SQL Server

Just been rewriting some SQL Server stored procedures for a client. There were a lot of SELECT statements like the one below: I’ve seen this quite a few times, and I’m not suggesting this is wrong, however I find that … Continue reading

Posted in Programming | Tagged , , , | Leave a comment

Parametrised SQL Server Stored Proc From ASP.net / C# / OLEDB

Lets assume that we have a stored procedure that is defined in the following way, it doesn’t really matter what the actual body of the SQL is: We want to be able to call this procedure from an ASP.net page … Continue reading

Posted in Programming | Tagged , , , , , , , , , | Leave a comment