Archive for July 2009

Writing filenames to a text file with Powershell

Warning: count(): Parameter must be an array or an object that implements Countable in /home/fbsqlcom/public_html/ on line 31

I had a task to do today that required me to get all the names in a directory of files into a database. This seemed like a ideal job for Powershell and I’ve posted the (very simple) script here. There’s a few variables you need to change to fit your environment; $directory – this should […]

Comparing T-SQL Cross Apply with MySQL GROUP_CONCAT

Steve Novoselac posted a good article about using CROSS APPLY with TSQL. This is a really useful technique for transforming data into grouped lists. It made me think of a similar feature in MySQL, a function, called GROUP_CONCAT. Here’s a demonstration of CROSS APPLY with TSQL and GROUP_CONCAT in MySQL to achieve the same thing. […]

Practical VBA Examples for the DBA: Part 1

I’ve never been a huge fan of VBA but it can be very useful for quickly providing interfaces to your databases. The examples here use Macros in Excel 2007 to execute stored procedures on SQL Server and provide data back to the user. These examples use the AdventureWorks sample database. Execute a Stored Procedure with […]

SQL Server Fulltext Search Primer

Previously I wrote an article about fulltext searching with MySQL and thought I’d redo the same article but for SQL Server users. Depending of which side of the database wars you’re on SQL Server has either a more advanced or complicated way of doing things. Here’s a very brief introduction to the fulltext search features […]

More Powershell Nuggets

In a previous post I provided a few small Powershell code blocks suitable for beginners to digest. Here are a few more that anyone starting with Powershell might like to experiment with. A simple For Loop in Powershell Here’s just a simple for loop in Powershell. ?View Code POWERSHELL# A simple for loop for($i = […]