Posts Tagged ‘SQL Server 2000’

Tuning Stored Procedures

This item was filled under [ SQL Server ]

Here are few tips to tune up stored procedures in SQL Server. I gathered these after doing some search on Google:

Include the ‘SET NOCOUNT ON‘ statement to stop the message indicating the number of rows affected (Reduces network traffic)
Break down the stored procedure in parts and call them from 1, esp. if you know that [...]

Continue reading...

Executing multiple INSERT in a single query

This item was filled under [ SQL Server ]

In SQL Server 2000, you can insert multiple records by using a single INSERT statement. It helps to boost performance a little and the task gets done in a single query.
Sample code:

INSERT INTO MyTable  (Col1, Col2)
SELECT  'First', 1
UNION ALL
SELECT  'Second', 2
UNION ALL
SELECT  'Third', 3
UNION ALL
SELECT  'Fourth', 4
UNION ALL
SELECT  'Fifth', 5
GO

Continue reading...