A little problem I had recently was to import a CSV file with about 16mb of data, into a Microsoft SQL 2005 database, using Microsoft SQL Studio Express. A csv file is a file with data that has “comma seperated values” (CSV) and by using SQL bulk load we can read this file from disk [...]
I had a problem when trying to bulk load a CSV file into my Microsoft SQL 2005 database. The error was “You do not have permission to use the bulk load statement”. It turned out to be quite a simple solution.
The solution: It was simply a permission issue and your SQL login needs to be [...]
I am currently building a mileage and distance calculator for one of my clients and needed a solution to calculate the distnace between 2 geocoded longitude and latitude points. I know this can be achieved using the Google GClientGeocoder, but I was looking for an SEO friendly and non Javascript / AJAX solution to produce [...]
Just a quick helper for anybody looking to create a table on Microsoft SQL Server, using TSQL. When setting up a table with an IDENTITY column, if you have the need to insert exisiting data into your new table, you must be familiar with the SET INDENTIY_INSERT [table] ON / OFF statement. One thing to note:
If [...]
Having recently implemented Microsoft SQL 2005 replication for a client, we had a few issues with developers trying to alter schema on the database if the table is under replication. The issue is caused because the Microsoft Visual GUI tools for SQL 2005, tries to drop and recreate the table, which is obviously not acceptable [...]
I recently setup replication for Microsoft SQL 2005 server for a client and needed to provide a list of tables to the client without primary keys, as these are not transferred in the replication. This script came in very handy so thought I would share.
SELECT c.name, b.name
FROM sys.tables b
INNER JOIN sys.schemas c ON b.schema_id = [...]
This can be a handy piece of code to have in your toolbox if you have a ColdFuson host that will not allow you to create DSN’s. Using this method, you can wrap this in a nice CFC that allows you to query a Microsoft SQL database. The object code example is as follows …
<cfscript>
classLoad = [...]
I have been looking for a way to back up my MS SQL database that is hosted remotely, so that in the event of switching hosts or needing to restore I have a complete backup of my database. Using SQL Express 2005 this was not possible as you need to backup to a UNC network [...]
I thought I would post this to help anybody else who might be struggling with loading large XML files and datasets into Microsoft SQL using ColdFusion.
Using this technique, you can use a Microsoft COM object called “SQLXMLBulkLoad.SQLXMLBulkLoad”. This is a very fast object that allows you to provide an XML mapping file, the XML file [...]
Currently working on restructuring some google sitemaps for my client. Instead of the usual query, loop, output process for a ColdFusion XML manipulation based task, I decided to get SQL server to do the work for me. Using FOR XML AUTO, ELEMENTS at the bottom of my query, I can get SQL to return the results of [...]