Category Archives: SQL

SQL Numbering a table in sequence without IDENTITY

This is for renumbering of the rows in a table with out IDENTITY. — add a rowid to the table ALTER TABLE #table_name ADD rowid int null — set the rowid vales to zero UPDATE #table_name SET rowid = 0 … Continue reading

Posted in Code, Snippets, SQL | Comments Off on SQL Numbering a table in sequence without IDENTITY

SQL – Synchronizing identity field between two tables

One thing that DBAs often have difficulty with is moving data from one database to another database. This may be to synchronize a development environment with databases or tables on other servers with the same data values. Fortunately MSSQL provides … Continue reading

Posted in Code, Snippets, SQL | Comments Off on SQL – Synchronizing identity field between two tables

CFSelect Multiple and ListQualify

If you need a multiple selection list and need to display its values dynamically from a query you can do this in one line of code within your form. <cfquery name=”getstatus” datasource=”myDSN”> select All as status from orderstable UNION ALL … Continue reading

Posted in Code, Coldfusion, Snippets, SQL | Comments Off on CFSelect Multiple and ListQualify

Coldfusion list to Modal Window Select to Javascript to Coldusion variable.

I think I have accomplished what was once thought impossible or at least improbable. I have passed variables to a Modal window, allowed the user to execute a form there, passed the variable back to the parent page using javascript, … Continue reading

Posted in Code, Coldfusion, Javascript, SQL | Comments Off on Coldfusion list to Modal Window Select to Javascript to Coldusion variable.

SQL adding new columns to query

Sometimes a table has all the fields you need and sometimes it doesn’t. I sometimes need to create flag fields or summary fields to hold additional information. So here are the methods I use. Add a 1 char flag field … Continue reading

Posted in Code, Snippets, SQL | Comments Off on SQL adding new columns to query