//
archives

Archive for

Import CSV File Using Stored Procedure SQL Server 2005

set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go Create PROCEDURE [dbo].[import_csv_dec] @user_created varchar(40), @file_name varchar(200) AS DECLARE @Err INTEGER DECLARE @ErrMsg VARCHAR(200) RETRY: BEGIN TRY –BEGIN TRANSACTION declare @jum int set @jum = (select count(*) from tbl_ft100_dec where file_name=@file_name) if @jum<1 begin exec (‘delete from tbl_ft100’) exec (‘delete from tbl_ft100_dec where file_name=”’+@file_name+””) exec (‘BULK insert tbl_ft100 … Continue reading

Empty Transaction Log SQL Server 2005 & 2008

A. SQL SERVER 2005 Handle error Transaction Log is full : set ANSI_NULLS ON set QUOTED_IDENTIFIER ON go — ============================================= — Author:        <Author,,Name> — Create date: <Create Date,,> — Description:    <Description,,> — ============================================= ALTER PROCEDURE [dbo].[empty_log] AS BEGIN — SHRINKFILE LOG FILE DBCC SHRINKFILE(<logicalname_log>, 1) BACKUP LOG <dbname> WITH TRUNCATE_ONLY DBCC SHRINKFILE(<logicalname_log>_log, 1) END B. … Continue reading

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 10 other subscribers
December 2011
M T W T F S S
 1234
567891011
12131415161718
19202122232425
262728293031  

Archives

Web Statistic

Blog Stats

  • 187,137 hits