Thursday, September 27, 2007

SQL Batch Insert

Following snippet can be used to quickly upload ‘|’ separated record in SQL 2005 database table:

bulk insert cass.dbo.Stage1Input

FROM 'E:\tmp\cass\InputRecordDB.txt'

WITH

(

BATCHSIZE = 5000,

FIELDTERMINATOR ='|'

)

GO

Tuesday, September 11, 2007

My son Aditya

My son Aditya aka Adi, who makes sure that I should not take more then two hours sleep at night.

Monday, September 10, 2007

SQL Helper 1.0


In my day to day SQL Server development tasks I wanted a tool which can help me automating deployment tasks. There are some great tools already available like SQL Management Console and Red-Gate SQL/Data Compare, however, these tools get failed when you have very specific requirements like:

  • Loading of object based on specific regular expression pattern – For instance, you specifically wants to load objects for scripting whose names qualifies a specific regular expression pattern
  • Loading of object from a file list – For instance, you have list of StoreProcedures in a flat file and you want to create a SQL Create script for these stored procedures only.
  • Both Drop and Create Schema at once – Management Console either let you create a drop schema or create schema. This tool provides option for both.
  • Comparing two databases – just like any other database compare tool do. Additionally I can control objects to be compared by regular expressions. Output file have list of different and common objects between two databases.

To address, these specific requirements I developed SQL Helper.



Please leave your email in comments to get a copy of source-code/exe of SQL Helper 1.0.