SQL Server Data Types Test Tables

These tables can be used for testing various data types of SQL Server. You can extend as needed. SET NUMERIC_ROUNDABORT OFF; SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT,QUOTED_IDENTIFIER, ANSI_NULLS ON; GO   — Create XML Schema Collection CREATE XML SCHEMA COLLECTION PartitionMapSchema AS N'<xs:schema attributeFormDefault=”unqualified” elementFormDefault=”qualified” xmlns:xs=”http://www.w3.org/2001/XMLSchema”> <xs:element name=”Partition_Map”> <xs:complexType> <xs:sequence> <xs:element maxOccurs=”unbounded” name=”Value” type=”xs:date” /> </xs:sequence>…

1

Column Information View for SQL Server

Here is a view that contains column information. This is useful if you need to create a DDL statement for a table. CREATE VIEW dbo.vColumnInfo AS SELECT tbl.name AS [Table_Name], SCHEMA_NAME(tbl.schema_id) AS [Table_Schema], CAST(ISNULL(cik.index_column_id , 0) AS BIT) AS [InPrimaryKey], CAST(ISNULL(( SELECT TOP 1 1 FROM sys.foreign_key_columns AS colfk WHERE colfk.parent_column_id = clmns.column_id AND colfk.parent_object_id…

4

Released – Cumulative update package 3 for SQL Server 2005 Service Pack 2

Here is the link. http://support.microsoft.com/default.aspx/kb/939537 Here are the fixes in this release. SQL bug numberKB article numberDescription 50001581938243 (http://support.microsoft.com/kb/938243/)FIX: Error message when you run a full-text query against a catalog in SQL Server 2005: “The execution of a full-text query failed. The content index is corrupt.” 50001585938712 (http://support.microsoft.com/kb/938712/)FIX: Some records in the fact table may…

1

Generate BCP, Bulk Insert code with TSQL

This script will generate tsql code to bcp and bulk load data for all tables in a given DB.   SET NOCOUNT ON GO   DECLARE @path nvarchar(2000), @batchsize nvarchar(40), @format nvarchar(40), @serverinstance nvarchar(200), @security nvarchar(800)   SET @path = ‘C:\Temp\’; SET @batchsize = ‘1000000’ — COMMIT EVERY n RECORDS SET @serverinstance = ‘PGALLUCC-M7’ –SQL…

5

That about sums up my day.

I was got to Hoboken, no path trains, so I waited for a bus. That got me to downtown, so I waited for another bus, but then the riots started, so I started walking….and walking and walking…took me 7 hours to get to our office, that on a normal day takes one hour and 45…

1

CA Erwin and Microsoft’s Visual Studio Team Edition for Database Professionals

This about sums it up! The integration of CA’s ERwin® Data Modeler with Microsoft’s Visual Studio Team Edition for Database Professionals brings together an industry-leading heterogeneous database design product with a focused MS SQL Server development and life cycle management environment to provide a rigorous platform from which you can manage the development and deployment…

0

SQL Server Function to Return DateName

This function will return the date name for a given date time. 1: USE [DW_SharedDimensions]; 2: GO 3: IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[util].[uf_GetDateName]’) AND type in (N’FN’, N’IF’, N’TF’, N’FS’, N’FT’)) 4: DROP FUNCTION [util].[uf_GetDateName] 5: GO 6: CREATE FUNCTION [util].[uf_GetDateName]( 7: @date DATETIME 8: ,@includetime bit 9: ,@timeformat tinyint)…

1