Tag Archives: sql server

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: Advertisements

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

Showing Two Different Scales on Y Axis SQL Server Reporting Services (SSRS)

Long time, no post… I was asked to create a graph showing throughput of bags on a conveyor grouped into 5 minute intervals. ¬†One of the requirements was to show two scales on the Y axis, bags / 5 minute … 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

SQL Server 2008 R2 Maintenance Cleanup Task Not Deleting bak Files

I noticed that my old backup files were not being deleted despite my Cleanup Task being set to delete all bak files more than a day old. Having checked, and double checked the path, file age, etc. I decided it … Continue reading

Posted in Programming | Tagged , , | Leave a comment

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

Populating Windows Forms ComboBox from SQL Server using OLEDB and DataTable

For the database connection, and populating the DataTable see my post: Populating ASP.net DropDownList from SQL Server using OLEDB and DataTable Hopefully you have now connected to your database and populated your DataTable. Now all we need to do is … Continue reading

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

Populating ASP.net DropDownList from SQL Server using OLEDB and DataTable

Firstly we need to ensure that we have referenced System.Data.OleDb in order to connect to the Database. Now the database connection: NB: for connection string help / information this is a great resource http://www.connectionstrings.com/ Now we have our open database … Continue reading

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