|
|
Some useful UDF for SQL Server 2000
|
Total Hit (2914) |
Introduction
UDF examples
Database creation date
Date the object was created
Get date part of datetime value
Get time part of datetime value
Get the number of working days between two dates
«B»Introduction«/B»
SQL Server 2000 supports User-Defined Functions (UDFs) - one or more Tr
....Read More |
Rating
|
|
|
|
|
Create Excel XLS from T-SQL
|
Total Hit (3991) |
This is a T-SQL script that uses OLE, ADO, Jet4 ISAM, and Linked Server to create and populate an Excel Workbook (XLS) file from T-SQL query. If the Excel Worksheet exists, the query will append to the "table".
The code is designed to be used by SQL Agent and to append to the step output with verb
....Read More |
Rating
|
|
|
|
|
|
|
Shrinking transaction log file on sql server 7.0
|
Total Hit (1929) |
Many times when I do bult insert/delete operation my transaction log grows very fast and I use this scipt to shrink it. This simple scrip will show you how to shrink transaction log file in SQL Server 7.0 when your DBCC SHRINKFILE command wont work. In most cases DBCC SHRINKFILE(<log filename>,<new
....Read More |
Rating
|
|
|
Generate sequence numbers within a group of values.
|
Total Hit (1460) |
This example shows how to generate sequence numbers within a group of values in a SELECT statement. With proper indexes & search conditions, the example using the SELECT statement with GROUP BY will be very efficient.
|
Rating
|
|
|
Accessing OLEDB Connection Managers in a SSIS Script Component
|
Total Hit (14213) |
Sometimes you may need to access OLEDB Connection Manager to execute Queries in Script. Here is the easy way to do that.
Credit : http://blogs.msdn.com/mattm/archive/2008/08/22/accessing-oledb-connection-managers-in-a-script.aspx
«code LangId=2»
Imports System
Imports System.Data
Imports
....Read More |
Rating
|
|
|
|
|
INSTEAD OF Triggers
|
Total Hit (1883) |
AFTER triggers (also known as FOR triggers) execute following the triggering action, such as an insert, update, or delete. For example, an AFTER trigger on an Employees table will fire after an UPDATE statement has been executed against the Employees table. Thus, the trigger does not fire until the
....Read More |
Rating
|
|
|
How to reset Identity of Autonumber column?
|
Total Hit (4870) |
There are two ways to reset identity field
1) Use TRUNCATE TABLE <mytable> rather than DELETE. This is a non-logged operation, however, and may not be what you need.
2) Use the DBCC CHECKIDENT command to reseed your identity value:
DBCC CHECKIDENT('mytable', RESEED, 0) -- next row inserted
....Read More |
Rating
|
|
|
|
|
|
T-SQL Programming Part 2 - Building a T-SQL Loop
|
Total Hit (975) |
This is the second article in my T-SQL programming series. This article will discuss building a program loop using T-SQL. In addition to talking about building a loop, I will also discuss ways of controlling the loop processing, and different methods to break out of a loop.
....Read More |
Rating
|
|
|
|
Introducing the SQL Server 'MDX in Analysis Services' Series
|
Total Hit (624) |
This is the first tutorial of a new series, MDX in Analysis Services, that I hope will help new users get up to speed quickly with multidimensional expressions (MDX). The series is designed to provide hands-on application of the fundamentals of MDX from the perspective of MS SQL Server 2000 Analysis
....Read More |
Rating
|
|
|
DTS Global Variables and Visual Basic .Net
|
Total Hit (704) |
1. In order to change the value of a DTS Global Variable of type String from VB.Net code, the variable must be programmatically removed from the collection and added back with its new value.
2. In order to change the value of a DTS Global Variable of type Date, the new value must be explictly cas
....Read More |
Rating
|
|
|
|
xp_regex: Regular Expressions in SQL Server 2000
|
Total Hit (617) |
Regular Expressions are probably the best tool for text parsing. Using Regular Expressions GREATLY simplifies anything for which you would normally use CHARINDEX, PATINDEX, SUBSTRING, STUFF, REPLACE, etc.
|
Rating
|
|
|
An Introduction to SQL Server Clustering
|
Total Hit (533) |
If your mission-critical SQL Server should experience a motherboard failure, how long will it be down? One hour, four hours, a day, or longer? How much will this cost your business in lost sales or productivity? And perhaps even more important to you, what will it do to your stress level?
....Read More |
Rating
|
|
|
Tutorial : Introduction To Global Variables
|
Total Hit (734) |
Global Variables allow you to make your DTS packages more flexible. Some of their uses include.
1. Storing Values passed around within a package.
2. Accepting values from outside the package to be used inside it.
3. Holding not only single values but multiple values in a recordset.
....Read More |
Rating
|
|
|
|
|