Showing posts with label saying. Show all posts
Showing posts with label saying. Show all posts

Friday, March 9, 2012

Error 0xC020209C in Flat File Connection Manager in SSIS

Hi,
I got this error in a Flat File connection manager, it was saying that the last column caused the disk I/O Buffer overflow, whereas the last column contains 188 characters at max.

Any Idea how to deal with it ?

Thanks,
FahadI set the type of Flat File Source object to Unicode and problem was no more. But I still wonder whats the reason of this error ?

Sunday, February 19, 2012

Error - subquery returning more than one value

Hie.

I have a trigger that monitors changes to my table fields but I get an error saying subquery returned more than one value.Below is the code for my trigger, hope you will figure out whats happening..

CREATE TRIGGER trgmyTableAuditFields ON myTable
WITH ENCRYPTION
FOR INSERT, UPDATE, DELETE
AS
BEGIN

DECLARE @.col VARCHAR(200)
DECLARE @.primarykeycol VARCHAR(200)
DECLARE @.sql VARCHAR(2000)
DECLARE @.action VARCHAR(200)
DECLARE @.AuditInsert BIT
DECLARE @.AuditUpdate BIT
DECLARE @.AuditDelete BIT

SELECT @.action =
CASE
WHEN (SELECT COUNT(*) FROM deleted) = 0 THEN 'INSERTION'
WHEN (SELECT COUNT(*) FROM inserted) = 0 THEN 'DELETION'
ELSE 'UPDATE'
END

DECLARE curAuditFields CURSOR FOR
SELECT c.[name], ac.[AuditInsert], ac.[AuditUpdate], ac.[AuditDelete]
FROM syscolumns c
INNER JOIN sysobjects o ON o.[id] = c.[id]
INNER JOIN aucAuditColumns ac ON ac.[Column] = c.[name] AND ac.[Table] = o.[name]
WHERE o.[name] = 'myTable'
AND c.[xtype] NOT IN (35, 99, 34)
OPEN curAuditFields

FETCH NEXT FROM curAuditFields INTO @.col, @.AuditInsert, @.AuditUpdate, @.AuditDelete

SELECT [EffectiveDate],[LowerThresholdAmount],[ThresholdAmount],[Percentage],[ID] INTO #new FROM inserted
SELECT [EffectiveDate],[LowerThresholdAmount],[ThresholdAmount],[Percentage],[ID] INTO #old FROM deleted

WHILE @.@.FETCH_STATUS = 0 BEGIN

IF (@.action = 'INSERTION' AND @.AuditInsert = 1) OR
(@.action = 'UPDATE' AND @.AuditUpdate = 1) OR
(@.action = 'DELETION' AND @.AuditDelete = 1)
BEGIN

SET @.sql = 'IF (SELECT [' + @.col + '] FROM #new) <> (SELECT [' + @.col + '] FROM #old) OR (SELECT COUNT(*) FROM #old) = 0 OR (SELECT COUNT(*) FROM #new) = 0 BEGIN' + CHAR(10) +
'DECLARE @.old VARCHAR(50)' + CHAR(10) +
'DECLARE @.new VARCHAR(50)' + CHAR(10) +
' DECLARE @.RecordVal VARCHAR(50)' + CHAR(10) +

' SELECT @.new = CAST([' + @.col + '] AS VARCHAR(50)) FROM #new' + CHAR(10) +
' SELECT @.old = CAST([' + @.col + '] AS VARCHAR(50)) FROM #old' + CHAR(10) +
' SELECT @.RecordVal = CAST([ID] AS VARCHAR(50)) FROM #old' + CHAR(10) +
'IF @.RecordVal IS NULL BEGIN' + CHAR(10) +
'SELECT @.RecordVal = CAST([ID] AS VARCHAR(50)) FROM #new' + CHAR(10) +
'END' + CHAR(10) +

'INSERT INTO AuditTable([Username], ModificationDate, SourceTable, ModifiedField, OldValue, NewValue, [Action], [RecordID])' + CHAR(10) +
'VALUES (''' + SUSER_SNAME(SUSER_SID()) + ''',''' + CAST(GETDATE() AS VARCHAR(20)) + ''', ''myTable'', ''' + @.col + ''', @.old, @.new, ''' + @.action + ''', @.RecordVal)' + CHAR(10) +
'END'
EXEC (@.sql)
END

FETCH NEXT FROM curAuditFields INTO @.col, @.AuditInsert, @.AuditUpdate, @.AuditDelete
END

DROP TABLE #new
DROP TABLE #old

CLOSE curAuditFields
DEALLOCATE curAuditFields
END

Quote:

Originally Posted by Aleck

Hie.

I have a trigger that monitors changes to my table fields but I get an error saying subquery returned more than one value.Below is the code for my trigger, hope you will figure out whats happening..

CREATE TRIGGER trgmyTableAuditFields ON myTable
WITH ENCRYPTION
FOR INSERT, UPDATE, DELETE
AS
BEGIN

DECLARE @.col VARCHAR(200)
DECLARE @.primarykeycol VARCHAR(200)
DECLARE @.sql VARCHAR(2000)
DECLARE @.action VARCHAR(200)
DECLARE @.AuditInsert BIT
DECLARE @.AuditUpdate BIT
DECLARE @.AuditDelete BIT

SELECT @.action =
CASE
WHEN (SELECT COUNT(*) FROM deleted) = 0 THEN 'INSERTION'
WHEN (SELECT COUNT(*) FROM inserted) = 0 THEN 'DELETION'
ELSE 'UPDATE'
END

DECLARE curAuditFields CURSOR FOR
SELECT c.[name], ac.[AuditInsert], ac.[AuditUpdate], ac.[AuditDelete]
FROM syscolumns c
INNER JOIN sysobjects o ON o.[id] = c.[id]
INNER JOIN aucAuditColumns ac ON ac.[Column] = c.[name] AND ac.[Table] = o.[name]
WHERE o.[name] = 'myTable'
AND c.[xtype] NOT IN (35, 99, 34)
OPEN curAuditFields

FETCH NEXT FROM curAuditFields INTO @.col, @.AuditInsert, @.AuditUpdate, @.AuditDelete

SELECT [EffectiveDate],[LowerThresholdAmount],[ThresholdAmount],[Percentage],[ID] INTO #new FROM inserted
SELECT [EffectiveDate],[LowerThresholdAmount],[ThresholdAmount],[Percentage],[ID] INTO #old FROM deleted

WHILE @.@.FETCH_STATUS = 0 BEGIN

IF (@.action = 'INSERTION' AND @.AuditInsert = 1) OR
(@.action = 'UPDATE' AND @.AuditUpdate = 1) OR
(@.action = 'DELETION' AND @.AuditDelete = 1)
BEGIN

SET @.sql = 'IF (SELECT [' + @.col + '] FROM #new) <> (SELECT [' + @.col + '] FROM #old) OR (SELECT COUNT(*) FROM #old) = 0 OR (SELECT COUNT(*) FROM #new) = 0 BEGIN' + CHAR(10) +
'DECLARE @.old VARCHAR(50)' + CHAR(10) +
'DECLARE @.new VARCHAR(50)' + CHAR(10) +
' DECLARE @.RecordVal VARCHAR(50)' + CHAR(10) +

' SELECT @.new = CAST([' + @.col + '] AS VARCHAR(50)) FROM #new' + CHAR(10) +
' SELECT @.old = CAST([' + @.col + '] AS VARCHAR(50)) FROM #old' + CHAR(10) +
' SELECT @.RecordVal = CAST([ID] AS VARCHAR(50)) FROM #old' + CHAR(10) +
'IF @.RecordVal IS NULL BEGIN' + CHAR(10) +
'SELECT @.RecordVal = CAST([ID] AS VARCHAR(50)) FROM #new' + CHAR(10) +
'END' + CHAR(10) +

'INSERT INTO AuditTable([Username], ModificationDate, SourceTable, ModifiedField, OldValue, NewValue, [Action], [RecordID])' + CHAR(10) +
'VALUES (''' + SUSER_SNAME(SUSER_SID()) + ''',''' + CAST(GETDATE() AS VARCHAR(20)) + ''', ''myTable'', ''' + @.col + ''', @.old, @.new, ''' + @.action + ''', @.RecordVal)' + CHAR(10) +
'END'
EXEC (@.sql)
END

FETCH NEXT FROM curAuditFields INTO @.col, @.AuditInsert, @.AuditUpdate, @.AuditDelete
END

DROP TABLE #new
DROP TABLE #old

CLOSE curAuditFields
DEALLOCATE curAuditFields
END


i did not continue reading your code...am not sure how efficient it is to put a CUSOR inside a trigger. maybe you would want to find another way of doing this

Error - log file for tempdb is full

Hi,
I'm using SQL Server 2000.
I often get this message on my server saying "the log file for database
'tempdb' is full. Back up the transaction log for the database to free up
some log space..". But it does not allow me to backup and truncate the
transaction log file for the tempdb, maunally from the Enterpirse manager.
The only way is to re-start the server which often is not a preferred way
becuase there are more than 300 users connected to the server and its
difficult and bad for the buisness.
Also, sometime ago I tried the following DBCC command:
DBCC SHRINKFILE(tempdb_log, 1)
But unfortunately after that whenever I re-start the server, the Autogrow
option for the tempdb is only "1 KB", which is very very low in our company's
buisness, which is a real time scenario with people working 24/7 and doing
heavy transactions.
So I have to remember alwyas , to manually change the autogrow option to 10%
or more.
Can someone please help. Its being a nuisance now specially with me only as
the database support person in the company and with me on leave sometimes
causes problems.
Thanks,
Somi
Hi,
Have a look into the below URL:-
http://www.aspfaq.com/show.asp?id=2446
Thanks
Hari
SQL Server MVP
"Somi" <Somi@.discussions.microsoft.com> wrote in message
news:94F948DC-0A8C-40B4-A125-FFE8FB0E25A4@.microsoft.com...
> Hi,
> I'm using SQL Server 2000.
> I often get this message on my server saying "the log file for database
> 'tempdb' is full. Back up the transaction log for the database to free up
> some log space..". But it does not allow me to backup and truncate the
> transaction log file for the tempdb, maunally from the Enterpirse manager.
> The only way is to re-start the server which often is not a preferred way
> becuase there are more than 300 users connected to the server and its
> difficult and bad for the buisness.
> Also, sometime ago I tried the following DBCC command:
> DBCC SHRINKFILE(tempdb_log, 1)
> But unfortunately after that whenever I re-start the server, the Autogrow
> option for the tempdb is only "1 KB", which is very very low in our
> company's
> buisness, which is a real time scenario with people working 24/7 and doing
> heavy transactions.
> So I have to remember alwyas , to manually change the autogrow option to
> 10%
> or more.
> Can someone please help. Its being a nuisance now specially with me only
> as
> the database support person in the company and with me on leave sometimes
> causes problems.
> Thanks,
> Somi
>
|||Hi,
try out this and schedule it in a job it will not effect ur ERP
database.
backup log tempdb with truncate_only
dbcc shrinkfile(templog,1)
select * from sysfiles
u can also create a stored procedure and schedule it that will check
the logfile size and if it reached to a certain size u can execute the
code(shrink) the shrinkfile will free the space on logfile but it will
not shrink the space on disk.
u have to backup the logfirst and then execute shrink file then it will
free the space on disk.
hope this help u
from
Doller
Hari Prasad wrote:[vbcol=seagreen]
> Hi,
> Have a look into the below URL:-
> http://www.aspfaq.com/show.asp?id=2446
> Thanks
> Hari
> SQL Server MVP
> "Somi" <Somi@.discussions.microsoft.com> wrote in message
> news:94F948DC-0A8C-40B4-A125-FFE8FB0E25A4@.microsoft.com...
|||Thanks Hari and Doller,
I am going through all the options provided by you both.
But I still have a doubt in my mind,
when I use "dbcc shrinkfile(templog,1)" command, will it restrict the auto
grow option of the tempdb log file to only 1 MB ? and this definitely is not
what i want in our scenario of heavy and continuous transactions & constant
use of #temp tables, cursors etc.
As I mentioned in my main issue that I've already tried this option and that
seems to have cause this problem that now the auto grow option for the tempdb
sits at 1 MB only, unitl i manually change it everytime the server re-starts.
Thanks,
Somi.
"doller" wrote:

> Hi,
> try out this and schedule it in a job it will not effect ur ERP
> database.
> backup log tempdb with truncate_only
> dbcc shrinkfile(templog,1)
> select * from sysfiles
> u can also create a stored procedure and schedule it that will check
> the logfile size and if it reached to a certain size u can execute the
> code(shrink) the shrinkfile will free the space on logfile but it will
> not shrink the space on disk.
> u have to backup the logfirst and then execute shrink file then it will
> free the space on disk.
> hope this help u
> from
> Doller
>
> Hari Prasad wrote:
>
|||1. Set the autogrow option on Model to 10%, tempdb is created from model.
2. Ensure there is enough disk space for the tempdb log - it will always
truncate automatically, you must be sure there is enough space for the log
on the hard drive... If not, add a second log on another drive - or move the
log to another drive..
that should take care of you...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Somi" <Somi@.discussions.microsoft.com> wrote in message
news:94F948DC-0A8C-40B4-A125-FFE8FB0E25A4@.microsoft.com...
> Hi,
> I'm using SQL Server 2000.
> I often get this message on my server saying "the log file for database
> 'tempdb' is full. Back up the transaction log for the database to free up
> some log space..". But it does not allow me to backup and truncate the
> transaction log file for the tempdb, maunally from the Enterpirse manager.
> The only way is to re-start the server which often is not a preferred way
> becuase there are more than 300 users connected to the server and its
> difficult and bad for the buisness.
> Also, sometime ago I tried the following DBCC command:
> DBCC SHRINKFILE(tempdb_log, 1)
> But unfortunately after that whenever I re-start the server, the Autogrow
> option for the tempdb is only "1 KB", which is very very low in our
> company's
> buisness, which is a real time scenario with people working 24/7 and doing
> heavy transactions.
> So I have to remember alwyas , to manually change the autogrow option to
> 10%
> or more.
> Can someone please help. Its being a nuisance now specially with me only
> as
> the database support person in the company and with me on leave sometimes
> causes problems.
> Thanks,
> Somi
>

Error - log file for tempdb is full

Hi,
I'm using SQL Server 2000.
I often get this message on my server saying "the log file for database
'tempdb' is full. Back up the transaction log for the database to free up
some log space..". But it does not allow me to backup and truncate the
transaction log file for the tempdb, maunally from the Enterpirse manager.
The only way is to re-start the server which often is not a preferred way
becuase there are more than 300 users connected to the server and its
difficult and bad for the buisness.
Also, sometime ago I tried the following DBCC command:
DBCC SHRINKFILE(tempdb_log, 1)
But unfortunately after that whenever I re-start the server, the Autogrow
option for the tempdb is only "1 KB", which is very very low in our company's
buisness, which is a real time scenario with people working 24/7 and doing
heavy transactions.
So I have to remember alwyas , to manually change the autogrow option to 10%
or more.
Can someone please help. Its being a nuisance now specially with me only as
the database support person in the company and with me on leave sometimes
causes problems.
Thanks,
SomiHi,
Have a look into the below URL:-
http://www.aspfaq.com/show.asp?id=2446
Thanks
Hari
SQL Server MVP
"Somi" <Somi@.discussions.microsoft.com> wrote in message
news:94F948DC-0A8C-40B4-A125-FFE8FB0E25A4@.microsoft.com...
> Hi,
> I'm using SQL Server 2000.
> I often get this message on my server saying "the log file for database
> 'tempdb' is full. Back up the transaction log for the database to free up
> some log space..". But it does not allow me to backup and truncate the
> transaction log file for the tempdb, maunally from the Enterpirse manager.
> The only way is to re-start the server which often is not a preferred way
> becuase there are more than 300 users connected to the server and its
> difficult and bad for the buisness.
> Also, sometime ago I tried the following DBCC command:
> DBCC SHRINKFILE(tempdb_log, 1)
> But unfortunately after that whenever I re-start the server, the Autogrow
> option for the tempdb is only "1 KB", which is very very low in our
> company's
> buisness, which is a real time scenario with people working 24/7 and doing
> heavy transactions.
> So I have to remember alwyas , to manually change the autogrow option to
> 10%
> or more.
> Can someone please help. Its being a nuisance now specially with me only
> as
> the database support person in the company and with me on leave sometimes
> causes problems.
> Thanks,
> Somi
>|||Hi,
try out this and schedule it in a job it will not effect ur ERP
database.
backup log tempdb with truncate_only
dbcc shrinkfile(templog,1)
select * from sysfiles
u can also create a stored procedure and schedule it that will check
the logfile size and if it reached to a certain size u can execute the
code(shrink) the shrinkfile will free the space on logfile but it will
not shrink the space on disk.
u have to backup the logfirst and then execute shrink file then it will
free the space on disk.
hope this help u
from
Doller
Hari Prasad wrote:
> Hi,
> Have a look into the below URL:-
> http://www.aspfaq.com/show.asp?id=2446
> Thanks
> Hari
> SQL Server MVP
> "Somi" <Somi@.discussions.microsoft.com> wrote in message
> news:94F948DC-0A8C-40B4-A125-FFE8FB0E25A4@.microsoft.com...
> > Hi,
> > I'm using SQL Server 2000.
> > I often get this message on my server saying "the log file for database
> > 'tempdb' is full. Back up the transaction log for the database to free up
> > some log space..". But it does not allow me to backup and truncate the
> > transaction log file for the tempdb, maunally from the Enterpirse manager.
> > The only way is to re-start the server which often is not a preferred way
> > becuase there are more than 300 users connected to the server and its
> > difficult and bad for the buisness.
> >
> > Also, sometime ago I tried the following DBCC command:
> > DBCC SHRINKFILE(tempdb_log, 1)
> >
> > But unfortunately after that whenever I re-start the server, the Autogrow
> > option for the tempdb is only "1 KB", which is very very low in our
> > company's
> > buisness, which is a real time scenario with people working 24/7 and doing
> > heavy transactions.
> >
> > So I have to remember alwyas , to manually change the autogrow option to
> > 10%
> > or more.
> >
> > Can someone please help. Its being a nuisance now specially with me only
> > as
> > the database support person in the company and with me on leave sometimes
> > causes problems.
> >
> > Thanks,
> > Somi
> >|||Thanks Hari and Doller,
I am going through all the options provided by you both.
But I still have a doubt in my mind,
when I use "dbcc shrinkfile(templog,1)" command, will it restrict the auto
grow option of the tempdb log file to only 1 MB ' and this definitely is not
what i want in our scenario of heavy and continuous transactions & constant
use of #temp tables, cursors etc.
As I mentioned in my main issue that I've already tried this option and that
seems to have cause this problem that now the auto grow option for the tempdb
sits at 1 MB only, unitl i manually change it everytime the server re-starts.
Thanks,
Somi.
"doller" wrote:
> Hi,
> try out this and schedule it in a job it will not effect ur ERP
> database.
> backup log tempdb with truncate_only
> dbcc shrinkfile(templog,1)
> select * from sysfiles
> u can also create a stored procedure and schedule it that will check
> the logfile size and if it reached to a certain size u can execute the
> code(shrink) the shrinkfile will free the space on logfile but it will
> not shrink the space on disk.
> u have to backup the logfirst and then execute shrink file then it will
> free the space on disk.
> hope this help u
> from
> Doller
>
> Hari Prasad wrote:
> > Hi,
> >
> > Have a look into the below URL:-
> >
> > http://www.aspfaq.com/show.asp?id=2446
> >
> > Thanks
> > Hari
> > SQL Server MVP
> >
> > "Somi" <Somi@.discussions.microsoft.com> wrote in message
> > news:94F948DC-0A8C-40B4-A125-FFE8FB0E25A4@.microsoft.com...
> > > Hi,
> > > I'm using SQL Server 2000.
> > > I often get this message on my server saying "the log file for database
> > > 'tempdb' is full. Back up the transaction log for the database to free up
> > > some log space..". But it does not allow me to backup and truncate the
> > > transaction log file for the tempdb, maunally from the Enterpirse manager.
> > > The only way is to re-start the server which often is not a preferred way
> > > becuase there are more than 300 users connected to the server and its
> > > difficult and bad for the buisness.
> > >
> > > Also, sometime ago I tried the following DBCC command:
> > > DBCC SHRINKFILE(tempdb_log, 1)
> > >
> > > But unfortunately after that whenever I re-start the server, the Autogrow
> > > option for the tempdb is only "1 KB", which is very very low in our
> > > company's
> > > buisness, which is a real time scenario with people working 24/7 and doing
> > > heavy transactions.
> > >
> > > So I have to remember alwyas , to manually change the autogrow option to
> > > 10%
> > > or more.
> > >
> > > Can someone please help. Its being a nuisance now specially with me only
> > > as
> > > the database support person in the company and with me on leave sometimes
> > > causes problems.
> > >
> > > Thanks,
> > > Somi
> > >
>|||1. Set the autogrow option on Model to 10%, tempdb is created from model.
2. Ensure there is enough disk space for the tempdb log - it will always
truncate automatically, you must be sure there is enough space for the log
on the hard drive... If not, add a second log on another drive - or move the
log to another drive..
that should take care of you...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Somi" <Somi@.discussions.microsoft.com> wrote in message
news:94F948DC-0A8C-40B4-A125-FFE8FB0E25A4@.microsoft.com...
> Hi,
> I'm using SQL Server 2000.
> I often get this message on my server saying "the log file for database
> 'tempdb' is full. Back up the transaction log for the database to free up
> some log space..". But it does not allow me to backup and truncate the
> transaction log file for the tempdb, maunally from the Enterpirse manager.
> The only way is to re-start the server which often is not a preferred way
> becuase there are more than 300 users connected to the server and its
> difficult and bad for the buisness.
> Also, sometime ago I tried the following DBCC command:
> DBCC SHRINKFILE(tempdb_log, 1)
> But unfortunately after that whenever I re-start the server, the Autogrow
> option for the tempdb is only "1 KB", which is very very low in our
> company's
> buisness, which is a real time scenario with people working 24/7 and doing
> heavy transactions.
> So I have to remember alwyas , to manually change the autogrow option to
> 10%
> or more.
> Can someone please help. Its being a nuisance now specially with me only
> as
> the database support person in the company and with me on leave sometimes
> causes problems.
> Thanks,
> Somi
>

Error - log file for tempdb is full

Hi,
I'm using SQL Server 2000.
I often get this message on my server saying "the log file for database
'tempdb' is full. Back up the transaction log for the database to free up
some log space..". But it does not allow me to backup and truncate the
transaction log file for the tempdb, maunally from the Enterpirse manager.
The only way is to re-start the server which often is not a preferred way
becuase there are more than 300 users connected to the server and its
difficult and bad for the buisness.
Also, sometime ago I tried the following DBCC command:
DBCC SHRINKFILE(tempdb_log, 1)
But unfortunately after that whenever I re-start the server, the Autogrow
option for the tempdb is only "1 KB", which is very very low in our company'
s
buisness, which is a real time scenario with people working 24/7 and doing
heavy transactions.
So I have to remember alwyas , to manually change the autogrow option to 10%
or more.
Can someone please help. Its being a nuisance now specially with me only as
the database support person in the company and with me on leave sometimes
causes problems.
Thanks,
SomiHi,
Have a look into the below URL:-
http://www.aspfaq.com/show.asp?id=2446
Thanks
Hari
SQL Server MVP
"Somi" <Somi@.discussions.microsoft.com> wrote in message
news:94F948DC-0A8C-40B4-A125-FFE8FB0E25A4@.microsoft.com...
> Hi,
> I'm using SQL Server 2000.
> I often get this message on my server saying "the log file for database
> 'tempdb' is full. Back up the transaction log for the database to free up
> some log space..". But it does not allow me to backup and truncate the
> transaction log file for the tempdb, maunally from the Enterpirse manager.
> The only way is to re-start the server which often is not a preferred way
> becuase there are more than 300 users connected to the server and its
> difficult and bad for the buisness.
> Also, sometime ago I tried the following DBCC command:
> DBCC SHRINKFILE(tempdb_log, 1)
> But unfortunately after that whenever I re-start the server, the Autogrow
> option for the tempdb is only "1 KB", which is very very low in our
> company's
> buisness, which is a real time scenario with people working 24/7 and doing
> heavy transactions.
> So I have to remember alwyas , to manually change the autogrow option to
> 10%
> or more.
> Can someone please help. Its being a nuisance now specially with me only
> as
> the database support person in the company and with me on leave sometimes
> causes problems.
> Thanks,
> Somi
>|||Hi,
try out this and schedule it in a job it will not effect ur ERP
database.
backup log tempdb with truncate_only
dbcc shrinkfile(templog,1)
select * from sysfiles
u can also create a stored procedure and schedule it that will check
the logfile size and if it reached to a certain size u can execute the
code(shrink) the shrinkfile will free the space on logfile but it will
not shrink the space on disk.
u have to backup the logfirst and then execute shrink file then it will
free the space on disk.
hope this help u
from
Doller
Hari Prasad wrote:[vbcol=seagreen]
> Hi,
> Have a look into the below URL:-
> http://www.aspfaq.com/show.asp?id=2446
> Thanks
> Hari
> SQL Server MVP
> "Somi" <Somi@.discussions.microsoft.com> wrote in message
> news:94F948DC-0A8C-40B4-A125-FFE8FB0E25A4@.microsoft.com...|||Thanks Hari and Doller,
I am going through all the options provided by you both.
But I still have a doubt in my mind,
when I use "dbcc shrinkfile(templog,1)" command, will it restrict the auto
grow option of the tempdb log file to only 1 MB ' and this definitely is no
t
what i want in our scenario of heavy and continuous transactions & constant
use of #temp tables, cursors etc.
As I mentioned in my main issue that I've already tried this option and that
seems to have cause this problem that now the auto grow option for the tempd
b
sits at 1 MB only, unitl i manually change it everytime the server re-starts
.
Thanks,
Somi.
"doller" wrote:

> Hi,
> try out this and schedule it in a job it will not effect ur ERP
> database.
> backup log tempdb with truncate_only
> dbcc shrinkfile(templog,1)
> select * from sysfiles
> u can also create a stored procedure and schedule it that will check
> the logfile size and if it reached to a certain size u can execute the
> code(shrink) the shrinkfile will free the space on logfile but it will
> not shrink the space on disk.
> u have to backup the logfirst and then execute shrink file then it will
> free the space on disk.
> hope this help u
> from
> Doller
>
> Hari Prasad wrote:
>|||1. Set the autogrow option on Model to 10%, tempdb is created from model.
2. Ensure there is enough disk space for the tempdb log - it will always
truncate automatically, you must be sure there is enough space for the log
on the hard drive... If not, add a second log on another drive - or move the
log to another drive..
that should take care of you...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Somi" <Somi@.discussions.microsoft.com> wrote in message
news:94F948DC-0A8C-40B4-A125-FFE8FB0E25A4@.microsoft.com...
> Hi,
> I'm using SQL Server 2000.
> I often get this message on my server saying "the log file for database
> 'tempdb' is full. Back up the transaction log for the database to free up
> some log space..". But it does not allow me to backup and truncate the
> transaction log file for the tempdb, maunally from the Enterpirse manager.
> The only way is to re-start the server which often is not a preferred way
> becuase there are more than 300 users connected to the server and its
> difficult and bad for the buisness.
> Also, sometime ago I tried the following DBCC command:
> DBCC SHRINKFILE(tempdb_log, 1)
> But unfortunately after that whenever I re-start the server, the Autogrow
> option for the tempdb is only "1 KB", which is very very low in our
> company's
> buisness, which is a real time scenario with people working 24/7 and doing
> heavy transactions.
> So I have to remember alwyas , to manually change the autogrow option to
> 10%
> or more.
> Can someone please help. Its being a nuisance now specially with me only
> as
> the database support person in the company and with me on leave sometimes
> causes problems.
> Thanks,
> Somi
>