» tagged pages
» logout

sorted by: recent | see : popular
Content Tagged with SQL + sqlserver

SQL Server And XML: XML Workshop

Creating RSS and ATOM feeds from SQL Server 2000 and SQL Server 2005 using TSQL, FOR XML PATH, and FOR XML EXPLICIT

XML: del.icio.us/tag/xml

SQL Protocols : Understanding Kerberos and NTLM authentication in SQL Server Connections

SPN registered for SQL instance, hence, NTLM is used, however, LocalSystem account inherits from System Context instead of a true user-based context, thus, failed as 'ANONYMOUS LOGON'

kerberos: del.icio.us/tag/Kerberos

XML Workshop XVIII - Generating an RSS 2.0 Feed with TSQL - SQL Server Central

XML Workshop XVIII - Generating an RSS 2.0 Feed with TSQL

XML: del.icio.us/tag/xml

15 Seconds : Retrieving Dynamic XML from SQL Server 7.0 and 2000

So the AUTO mode allows us to create the XML document we want, but the following disadvantages become apparent with further use:

XML: del.icio.us/tag/xml

INFORMATION_SCHEMA Support in MySQL, PostgreSQL

I've known about the INFORMATION_SCHEMA views (or system tables) in SQL Server for a while, but I just leared recently that they are actually part of the SQL-92 standard and supported on other database platforms.

The INFORMATION_SCHEMA views provide meta data information about the tables, columns, and other parts of your database. Because the structure of these tables are standardized you can write SQL statements that work on various database platforms.

For example suppose you want to return a resultset with a list of all columns in a table called employees

SELECT table_name, column_name, is_nullable, data_type, character_maximum_length
FROM INFORMATION_SCHEMA.Columns
WHERE table_name = 'employees'

Quite a handy feature, but it's hard to find what versions the of various database platforms started supporting this feature, here's a quick list:

  • Microsoft SQL Server - Supported in Version 7 and up
  • MySQL - Supported in Version 5 and up
  • PostgreSQL - Supported in Version 7.4 and up
  • Oracle - Does not appear to be supported
  • Apache Derby - NOT Supported As of Version 10.3

I have been using the INFORMATION_SCHEMA views to build some automatic datatype validation. With the INFORMATION_SCHEMA you can get the datatype, max character length, and if null values are allowed, and perform validation before it hits the database. And if a column is made wider, you don't have to make any code changes.

Ofcourse if you are using ColdFusion 8, you can use the new cfdbinfo tag to get the same column information. The cfdbinfo actually uses the JDBC Driver's getMetaData() method (this is part of the JDBC Standard that Drivers implement this method). Apache Derby doesn't support the INFORMATION_SCHEMA views because they prefer to simply implement the JDBC Driver's getMetaData() method.

Here's a list of the information schema views:

  • INFORMATION_SCHEMA.SCHEMATA
  • INFORMATION_SCHEMA.TABLES
  • INFORMATION_SCHEMA.COLUMNS
  • INFORMATION_SCHEMA.STATISTICS
  • INFORMATION_SCHEMA.USER_PRIVILEGES
  • INFORMATION_SCHEMA.SCHEMA_PRIVILEGES
  • INFORMATION_SCHEMA.TABLE_PRIVILEGES
  • INFORMATION_SCHEMA.COLUMN_PRIVILEGES
  • INFORMATION_SCHEMA.CHARACTER_SETS
  • INFORMATION_SCHEMA.COLLATIONS
  • INFORMATION_SCHEMA.COLLATION_CHARACTER_SET_APPLICABILITY
  • INFORMATION_SCHEMA.TABLE_CONSTRAINTS
  • INFORMATION_SCHEMA.KEY_COLUMN_USAGE
  • INFORMATION_SCHEMA.ROUTINES
  • INFORMATION_SCHEMA.VIEWS
  • INFORMATION_SCHEMA.TRIGGERS
  • INFORMATION_SCHEMA.PROFILING

Roland Bouman has created a clickable ER diagram of the INFORMATION_SCHEMA for MySQL (click on the table to go to the MySQL documentation for the table)

MySQL: Planet MySQL

nodes() Method (xml Data Type)

when you want to shred an xml data type instance into relational data. It allows you to identify nodes that will be mapped into a new row.

XML: del.icio.us/tag/xml

Page 1 | Next >>