Showing posts with label back. Show all posts
Showing posts with label back. Show all posts

Wednesday, March 21, 2012

Differntial Backup doesn't work

I setup Differntial Backup through EM but it doesn't
work. The backup file added up 1G in every back up and
end up with running out of space.
Can anybody tell me what's wrong?
Frankprobably you are adding backup into existing backup over and over, causing
it increases until no more empty sapce. You need to review your backup
strategy.
"Frank Jiang" <frank@.discussions.microsoft.com> wrote in message
news:2b6401c3e1d6$bbf8c6c0$a301280a@.phx.gbl...
quote:

> I setup Differntial Backup through EM but it doesn't
> work. The backup file added up 1G in every back up and
> end up with running out of space.
> Can anybody tell me what's wrong?
> Frank
|||I do a complete backup once eveyday and differential
backup every 20 minutes, append to media.
I check all the setting of the differential backup in
Enterprise Manager and didn't find anything wrong.
Frank
quote:

>--Original Message--
>probably you are adding backup into existing backup over

and over, causing
quote:

>it increases until no more empty sapce. You need to

review your backup
quote:

>strategy.
>"Frank Jiang" <frank@.discussions.microsoft.com> wrote in

message
quote:

>news:2b6401c3e1d6$bbf8c6c0$a301280a@.phx.gbl...
>
>.
>
|||with differential backup you don't have the option to restore DB to a
certain time.
Can you do differential backup every 4 hrs and do log backup every 20
minutes to a separate backup device? It may help.
"Frank J" <frank@.discussions.microsoft.com> wrote in message
news:330801c3e1da$b4ee92c0$a501280a@.phx.gbl...[QUOTE]
> I do a complete backup once eveyday and differential
> backup every 20 minutes, append to media.
> I check all the setting of the differential backup in
> Enterprise Manager and didn't find anything wrong.
> Frank
>
> and over, causing
> review your backup
> message|||It never happened so far that we need to restore DB. But
theoretically, we can resote DB from a complete backup
and on top of that we do recover from differential
backup. Thats why we do a complete backup everyday and
followed by 20 minutes differential backup.
Transaction log is huge and should we backup it?
Frank
quote:

>--Original Message--
>with differential backup you don't have the option to

restore DB to a
quote:

>certain time.
>Can you do differential backup every 4 hrs and do log

backup every 20
quote:

>minutes to a separate backup device? It may help.
>
>"Frank J" <frank@.discussions.microsoft.com> wrote in

message
quote:

>news:330801c3e1da$b4ee92c0$a501280a@.phx.gbl...
over[QUOTE]
in[QUOTE]
and[QUOTE]
>
>.
>
|||from BOL: A differential backup creates a copy of all the pages in a
database modified after the last database backup.
so to restore you just need a full backup and the last differential backup.
You keep adding differential backup into same backup device every 20 minutes
then no wonder it keeps growing 'til you are out of space.
quote:

> Transaction log is huge and should we backup it?

depend on your needs. I always backup the log.
"Frank J" <anonymous@.discussions.microsoft.com> wrote in message
news:2cbc01c3e1e7$7aef6470$a101280a@.phx.gbl...[QUOTE]
> It never happened so far that we need to restore DB. But
> theoretically, we can resote DB from a complete backup
> and on top of that we do recover from differential
> backup. Thats why we do a complete backup everyday and
> followed by 20 minutes differential backup.
> Transaction log is huge and should we backup it?
> Frank
>
> restore DB to a
> backup every 20
> message
> over
> in
> and

Differntial Backup doesn't work

I setup Differntial Backup through EM but it doesn't
work. The backup file added up 1G in every back up and
end up with running out of space.
Can anybody tell me what's wrong?
Frankprobably you are adding backup into existing backup over and over, causing
it increases until no more empty sapce. You need to review your backup
strategy.
"Frank Jiang" <frank@.discussions.microsoft.com> wrote in message
news:2b6401c3e1d6$bbf8c6c0$a301280a@.phx.gbl...
> I setup Differntial Backup through EM but it doesn't
> work. The backup file added up 1G in every back up and
> end up with running out of space.
> Can anybody tell me what's wrong?
> Frank|||I do a complete backup once eveyday and differential
backup every 20 minutes, append to media.
I check all the setting of the differential backup in
Enterprise Manager and didn't find anything wrong.
Frank
>--Original Message--
>probably you are adding backup into existing backup over
and over, causing
>it increases until no more empty sapce. You need to
review your backup
>strategy.
>"Frank Jiang" <frank@.discussions.microsoft.com> wrote in
message
>news:2b6401c3e1d6$bbf8c6c0$a301280a@.phx.gbl...
>> I setup Differntial Backup through EM but it doesn't
>> work. The backup file added up 1G in every back up and
>> end up with running out of space.
>> Can anybody tell me what's wrong?
>> Frank
>
>.
>|||with differential backup you don't have the option to restore DB to a
certain time.
Can you do differential backup every 4 hrs and do log backup every 20
minutes to a separate backup device? It may help.
"Frank J" <frank@.discussions.microsoft.com> wrote in message
news:330801c3e1da$b4ee92c0$a501280a@.phx.gbl...
> I do a complete backup once eveyday and differential
> backup every 20 minutes, append to media.
> I check all the setting of the differential backup in
> Enterprise Manager and didn't find anything wrong.
> Frank
> >--Original Message--
> >probably you are adding backup into existing backup over
> and over, causing
> >it increases until no more empty sapce. You need to
> review your backup
> >strategy.
> >
> >"Frank Jiang" <frank@.discussions.microsoft.com> wrote in
> message
> >news:2b6401c3e1d6$bbf8c6c0$a301280a@.phx.gbl...
> >> I setup Differntial Backup through EM but it doesn't
> >> work. The backup file added up 1G in every back up and
> >> end up with running out of space.
> >>
> >> Can anybody tell me what's wrong?
> >>
> >> Frank
> >
> >
> >.
> >|||It never happened so far that we need to restore DB. But
theoretically, we can resote DB from a complete backup
and on top of that we do recover from differential
backup. Thats why we do a complete backup everyday and
followed by 20 minutes differential backup.
Transaction log is huge and should we backup it?
Frank
>--Original Message--
>with differential backup you don't have the option to
restore DB to a
>certain time.
>Can you do differential backup every 4 hrs and do log
backup every 20
>minutes to a separate backup device? It may help.
>
>"Frank J" <frank@.discussions.microsoft.com> wrote in
message
>news:330801c3e1da$b4ee92c0$a501280a@.phx.gbl...
>> I do a complete backup once eveyday and differential
>> backup every 20 minutes, append to media.
>> I check all the setting of the differential backup in
>> Enterprise Manager and didn't find anything wrong.
>> Frank
>> >--Original Message--
>> >probably you are adding backup into existing backup
over
>> and over, causing
>> >it increases until no more empty sapce. You need to
>> review your backup
>> >strategy.
>> >
>> >"Frank Jiang" <frank@.discussions.microsoft.com> wrote
in
>> message
>> >news:2b6401c3e1d6$bbf8c6c0$a301280a@.phx.gbl...
>> >> I setup Differntial Backup through EM but it doesn't
>> >> work. The backup file added up 1G in every back up
and
>> >> end up with running out of space.
>> >>
>> >> Can anybody tell me what's wrong?
>> >>
>> >> Frank
>> >
>> >
>> >.
>> >
>
>.
>|||from BOL: A differential backup creates a copy of all the pages in a
database modified after the last database backup.
so to restore you just need a full backup and the last differential backup.
You keep adding differential backup into same backup device every 20 minutes
then no wonder it keeps growing 'til you are out of space.
> Transaction log is huge and should we backup it?
depend on your needs. I always backup the log.
"Frank J" <anonymous@.discussions.microsoft.com> wrote in message
news:2cbc01c3e1e7$7aef6470$a101280a@.phx.gbl...
> It never happened so far that we need to restore DB. But
> theoretically, we can resote DB from a complete backup
> and on top of that we do recover from differential
> backup. Thats why we do a complete backup everyday and
> followed by 20 minutes differential backup.
> Transaction log is huge and should we backup it?
> Frank
> >--Original Message--
> >with differential backup you don't have the option to
> restore DB to a
> >certain time.
> >Can you do differential backup every 4 hrs and do log
> backup every 20
> >minutes to a separate backup device? It may help.
> >
> >
> >"Frank J" <frank@.discussions.microsoft.com> wrote in
> message
> >news:330801c3e1da$b4ee92c0$a501280a@.phx.gbl...
> >> I do a complete backup once eveyday and differential
> >> backup every 20 minutes, append to media.
> >> I check all the setting of the differential backup in
> >> Enterprise Manager and didn't find anything wrong.
> >>
> >> Frank
> >>
> >> >--Original Message--
> >> >probably you are adding backup into existing backup
> over
> >> and over, causing
> >> >it increases until no more empty sapce. You need to
> >> review your backup
> >> >strategy.
> >> >
> >> >"Frank Jiang" <frank@.discussions.microsoft.com> wrote
> in
> >> message
> >> >news:2b6401c3e1d6$bbf8c6c0$a301280a@.phx.gbl...
> >> >> I setup Differntial Backup through EM but it doesn't
> >> >> work. The backup file added up 1G in every back up
> and
> >> >> end up with running out of space.
> >> >>
> >> >> Can anybody tell me what's wrong?
> >> >>
> >> >> Frank
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >sql

Sunday, March 11, 2012

Differential Backup Size and Transaction Log Backup Size !

Hello All,
Sometime back we had scheduled Differential database backups on our OLTP
system. The backup is scheduled to run once at 6AM, once at 12Noon and
7PM. This backup is apart from the half hourly transaction log backup
and the daily full database backup.
Normally, for a day, the Transaction log backup does not exceed 300MB and
the 6AM Diff backup does not exceed 400MB, the 12Noon Diff backup does not
exceed 500MB and the 7PM Diff backup does not exceed 600MB.
However, sometimes, I notice that the 6AM Diff backup is around 1100MB,
the 12Noon Diff backup around 1300MB and the 7PM Diff backup around 1400MB
but the Transaction log backup still 300MB.
I would expect the Transaction Log backup also to show around 1500MB.
Does anyone know why the differential database backup is so large when
compared to the Transaction Log.
Thanks,
RgnOne explanation would be that you move to bulk logged recovery mode, and
bcp'd in a lot of data ( which is minimally logged).
Another explanation would be that you dropped/re-created a bunch of indexes,
only the drop/create statement would be in the log, but the entire index
would be copied in the differential backup.
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.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
"rgn" <anonymous@.discussions.microsoft.com> wrote in message
news:9B20C782-042B-4D0C-857C-F68787C5C45C@.microsoft.com...
> Hello All,
> Sometime back we had scheduled Differential database backups on our OLTP
> system. The backup is scheduled to run once at 6AM, once at 12Noon and
> 7PM. This backup is apart from the half hourly transaction log backup
> and the daily full database backup.
> Normally, for a day, the Transaction log backup does not exceed 300MB and
> the 6AM Diff backup does not exceed 400MB, the 12Noon Diff backup does not
> exceed 500MB and the 7PM Diff backup does not exceed 600MB.
> However, sometimes, I notice that the 6AM Diff backup is around 1100MB,
> the 12Noon Diff backup around 1300MB and the 7PM Diff backup around 1400MB
> but the Transaction log backup still 300MB.
> I would expect the Transaction Log backup also to show around 1500MB.
> Does anyone know why the differential database backup is so large when
> compared to the Transaction Log.
> Thanks,
> Rgn|||Wayne
You are very true in saying that the bulk-logged operation generates a large transaction log backup and/or differential DB backup. However, my question is that, if the differential Db backup is 1.5GB then even the transaction log backup shoul
be of simillar size, right
In my case, the transaction log seems to be only 300MB where as the differential db backup is 1.4GB
rgn

Differential Backup file fails to restore.

We are doing the following steps:-

1. Weekly Full Bckup

2.Daily Differential backup

3.hr Log back up

The following command works fine for all the Backups. it means backup file is fine.

RESTORE FILELISTONLY from DISK = 'D:\Backup\new\DB_ full.BAK'

RESTORE HEADERONLY FROM DISK = 'D:\Backup\new\DB_ ull.BAK'

RESTORE LABELONLY FROM DISK = 'D:\Backup\new\Test_full.BAK'

RESTORE VERIFYONLY FROM DISK = 'D:\Backup\new\Test_full.BAK'

Also The full back up restoration works fine:

RESTORE DATABASE Test3 FROM DISK = 'D:\Backup\new\Test_full.BAK'

WITH MOVE 'Test2_Data' TO 'F:\MSSQL2K\MSSQL\data\Test2Net_Data.MDF',

MOVE 'Test2_Log' TO 'F:\MSSQL2K\MSSQL\data\Test2Net_Log.LDF',

NORECOVERY

GO

/* RESULT :

Processed 1032 pages for database 'Test3', file 'test2_Data' on file 1.

Processed 1 pages for database 'Test3', file 'test2_Log' on file 1.

RESTORE DATABASE successfully processed 1033 pages in 1.907 seconds (4.433 MB/sec).

*/

But While restoring the Differential file it throws error:

RESTORE DATABASE Test3 from DISK = 'D:\Backup\new\test2_Diff1.bak'

WITH NORECOVERY

GO

Msg 3136, Level 16, State 0, Line 1

Cannot apply the backup on device 'D:\Backup\new\test2_Diff1.bak' to database 'Test3'.

Msg 3013, Level 16, State 1, Line 1

RESTORE DATABASE is terminating abnormally.

I checked the SQL Server Log no error msg corresponding Differential backup restore.

I don't know how to proceed further.Can any one guide me how to over come this..

Thanks !

is the differential backup appended or overwritten ? ? ?........if appended choose the exact differential backup and try to restore....also try using GUI and see........|||Differential backup is a separate file...

DIFFERENTIAL BACKUP ERROR

Hi ,
I am running a job for taking a differential back up of a Merge replicated
database.
in week days the differential backup will run and on sunday the normal
backup will overwrite the differential back up.again from monday differential
back up will start.
the backup job is running correctly.when i try to restore the differential
back up it's working upto 4th day.for 5th and 6 th its not working and giving
an error.
here i am listing my backup job code
declare @.Weekday INT
SET @.Weekday=0
SET @.Weekday=datepart(weekday,getdate())
IF @.Weekday<>1
BEGIN
BACKUP DATABASE DIFFBACKUP
TO DISK ='F:\BackUp\DIFFBACKUPBACKUP.DAT' WITH DIFFERENTIAL ,
NOUNLOAD , NAME = N'DIFFBACKUPBACKUP', NOSKIP ,
STATS = 10, NOFORMAT
END
IF @.Weekday=1
BEGIN
BACKUP DATABASE DIFFBACKUP
TO DISK ='F:\BackUp\DIFFBACKUPBACKUP.DAT' WITH INIT ,
NOUNLOAD , NAME = N'DIFFBACKUPBACKUP', NOSKIP ,
STATS = 10, NOFORMAT
END
Please help.i am unable to identify the problem.
thanks,
reddy.
reddy
What is an error that you've got?
"reddy" <reddy@.discussions.microsoft.com> wrote in message
news:057BCACB-136F-42A4-82C4-3613A94B222B@.microsoft.com...
> Hi ,
> I am running a job for taking a differential back up of a Merge replicated
> database.
> in week days the differential backup will run and on sunday the normal
> backup will overwrite the differential back up.again from monday
differential
> back up will start.
> the backup job is running correctly.when i try to restore the differential
> back up it's working upto 4th day.for 5th and 6 th its not working and
giving
> an error.
> here i am listing my backup job code
> declare @.Weekday INT
> SET @.Weekday=0
> SET @.Weekday=datepart(weekday,getdate())
> IF @.Weekday<>1
> BEGIN
> BACKUP DATABASE DIFFBACKUP
> TO DISK ='F:\BackUp\DIFFBACKUPBACKUP.DAT' WITH DIFFERENTIAL ,
> NOUNLOAD , NAME = N'DIFFBACKUPBACKUP', NOSKIP ,
> STATS = 10, NOFORMAT
> END
> IF @.Weekday=1
> BEGIN
> BACKUP DATABASE DIFFBACKUP
> TO DISK ='F:\BackUp\DIFFBACKUPBACKUP.DAT' WITH INIT ,
> NOUNLOAD , NAME = N'DIFFBACKUPBACKUP', NOSKIP ,
> STATS = 10, NOFORMAT
> END
> Please help.i am unable to identify the problem.
> thanks,
> reddy.
>
>
>
|||The error is
can not apply the backup on device 'c:\mssql\test.dat' to database test
restore database is terminating abnormally.
the backup job aim is from monday to saturday differential backup, on sunday
normal backup will overwrite all the differential backups.i am able to
restore differential backups till thursday.after that any backup i am unable
to restore.i am getting the above error.
your help is appreciated.
thanks
reddy.
"Uri Dimant" wrote:

> reddy
> What is an error that you've got?
> "reddy" <reddy@.discussions.microsoft.com> wrote in message
> news:057BCACB-136F-42A4-82C4-3613A94B222B@.microsoft.com...
> differential
> giving
>
>

DIFFERENTIAL BACKUP ERROR

Hi ,
I am running a job for taking a differential back up of a Merge replicated
database.
in week days the differential backup will run and on sunday the normal
backup will overwrite the differential back up.again from monday differentia
l
back up will start.
the backup job is running correctly.when i try to restore the differential
back up it's working upto 4th day.for 5th and 6 th its not working and givin
g
an error.
here i am listing my backup job code
declare @.Weekday INT
SET @.Weekday=0
SET @.Weekday=datepart(weekday,getdate())
IF @.Weekday<>1
BEGIN
BACKUP DATABASE DIFFBACKUP
TO DISK ='F:\BackUp\DIFFBACKUPBACKUP.DAT' WITH DIFFERENTIAL ,
NOUNLOAD , NAME = N'DIFFBACKUPBACKUP', NOSKIP ,
STATS = 10, NOFORMAT
END
IF @.Weekday=1
BEGIN
BACKUP DATABASE DIFFBACKUP
TO DISK ='F:\BackUp\DIFFBACKUPBACKUP.DAT' WITH INIT ,
NOUNLOAD , NAME = N'DIFFBACKUPBACKUP', NOSKIP ,
STATS = 10, NOFORMAT
END
Please help.i am unable to identify the problem.
thanks,
reddy.reddy
What is an error that you've got?
"reddy" <reddy@.discussions.microsoft.com> wrote in message
news:057BCACB-136F-42A4-82C4-3613A94B222B@.microsoft.com...
> Hi ,
> I am running a job for taking a differential back up of a Merge replicated
> database.
> in week days the differential backup will run and on sunday the normal
> backup will overwrite the differential back up.again from monday
differential
> back up will start.
> the backup job is running correctly.when i try to restore the differential
> back up it's working upto 4th day.for 5th and 6 th its not working and
giving
> an error.
> here i am listing my backup job code
> declare @.Weekday INT
> SET @.Weekday=0
> SET @.Weekday=datepart(weekday,getdate())
> IF @.Weekday<>1
> BEGIN
> BACKUP DATABASE DIFFBACKUP
> TO DISK ='F:\BackUp\DIFFBACKUPBACKUP.DAT' WITH DIFFERENTIAL ,
> NOUNLOAD , NAME = N'DIFFBACKUPBACKUP', NOSKIP ,
> STATS = 10, NOFORMAT
> END
> IF @.Weekday=1
> BEGIN
> BACKUP DATABASE DIFFBACKUP
> TO DISK ='F:\BackUp\DIFFBACKUPBACKUP.DAT' WITH INIT ,
> NOUNLOAD , NAME = N'DIFFBACKUPBACKUP', NOSKIP ,
> STATS = 10, NOFORMAT
> END
> Please help.i am unable to identify the problem.
> thanks,
> reddy.
>
>
>|||The error is
can not apply the backup on device 'c:\mssql\test.dat' to database test
restore database is terminating abnormally.
the backup job aim is from monday to saturday differential backup, on sunday
normal backup will overwrite all the differential backups.i am able to
restore differential backups till thursday.after that any backup i am unable
to restore.i am getting the above error.
your help is appreciated.
thanks
reddy.
"Uri Dimant" wrote:

> reddy
> What is an error that you've got?
> "reddy" <reddy@.discussions.microsoft.com> wrote in message
> news:057BCACB-136F-42A4-82C4-3613A94B222B@.microsoft.com...
> differential
> giving
>
>

DIFFERENTIAL BACKUP ERROR

Hi ,
I am running a job for taking a differential back up of a Merge replicated
database.
in week days the differential backup will run and on sunday the normal
backup will overwrite the differential back up.again from monday differential
back up will start.
the backup job is running correctly.when i try to restore the differential
back up it's working upto 4th day.for 5th and 6 th its not working and giving
an error.
here i am listing my backup job code
declare @.Weekday INT
SET @.Weekday=0
SET @.Weekday=datepart(weekday,getdate())
IF @.Weekday<>1
BEGIN
BACKUP DATABASE DIFFBACKUP
TO DISK ='F:\BackUp\DIFFBACKUPBACKUP.DAT' WITH DIFFERENTIAL ,
NOUNLOAD , NAME = N'DIFFBACKUPBACKUP', NOSKIP ,
STATS = 10, NOFORMAT
END
IF @.Weekday=1
BEGIN
BACKUP DATABASE DIFFBACKUP
TO DISK ='F:\BackUp\DIFFBACKUPBACKUP.DAT' WITH INIT ,
NOUNLOAD , NAME = N'DIFFBACKUPBACKUP', NOSKIP ,
STATS = 10, NOFORMAT
END
Please help.i am unable to identify the problem.
thanks,
reddy.reddy
What is an error that you've got?
"reddy" <reddy@.discussions.microsoft.com> wrote in message
news:057BCACB-136F-42A4-82C4-3613A94B222B@.microsoft.com...
> Hi ,
> I am running a job for taking a differential back up of a Merge replicated
> database.
> in week days the differential backup will run and on sunday the normal
> backup will overwrite the differential back up.again from monday
differential
> back up will start.
> the backup job is running correctly.when i try to restore the differential
> back up it's working upto 4th day.for 5th and 6 th its not working and
giving
> an error.
> here i am listing my backup job code
> declare @.Weekday INT
> SET @.Weekday=0
> SET @.Weekday=datepart(weekday,getdate())
> IF @.Weekday<>1
> BEGIN
> BACKUP DATABASE DIFFBACKUP
> TO DISK ='F:\BackUp\DIFFBACKUPBACKUP.DAT' WITH DIFFERENTIAL ,
> NOUNLOAD , NAME = N'DIFFBACKUPBACKUP', NOSKIP ,
> STATS = 10, NOFORMAT
> END
> IF @.Weekday=1
> BEGIN
> BACKUP DATABASE DIFFBACKUP
> TO DISK ='F:\BackUp\DIFFBACKUPBACKUP.DAT' WITH INIT ,
> NOUNLOAD , NAME = N'DIFFBACKUPBACKUP', NOSKIP ,
> STATS = 10, NOFORMAT
> END
> Please help.i am unable to identify the problem.
> thanks,
> reddy.
>
>
>|||The error is
can not apply the backup on device 'c:\mssql\test.dat' to database test
restore database is terminating abnormally.
the backup job aim is from monday to saturday differential backup, on sunday
normal backup will overwrite all the differential backups.i am able to
restore differential backups till thursday.after that any backup i am unable
to restore.i am getting the above error.
your help is appreciated.
thanks
reddy.
"Uri Dimant" wrote:
> reddy
> What is an error that you've got?
> "reddy" <reddy@.discussions.microsoft.com> wrote in message
> news:057BCACB-136F-42A4-82C4-3613A94B222B@.microsoft.com...
> > Hi ,
> >
> > I am running a job for taking a differential back up of a Merge replicated
> > database.
> > in week days the differential backup will run and on sunday the normal
> > backup will overwrite the differential back up.again from monday
> differential
> > back up will start.
> > the backup job is running correctly.when i try to restore the differential
> > back up it's working upto 4th day.for 5th and 6 th its not working and
> giving
> > an error.
> > here i am listing my backup job code
> >
> > declare @.Weekday INT
> > SET @.Weekday=0
> > SET @.Weekday=datepart(weekday,getdate())
> >
> > IF @.Weekday<>1
> > BEGIN
> > BACKUP DATABASE DIFFBACKUP
> > TO DISK ='F:\BackUp\DIFFBACKUPBACKUP.DAT' WITH DIFFERENTIAL ,
> > NOUNLOAD , NAME = N'DIFFBACKUPBACKUP', NOSKIP ,
> > STATS = 10, NOFORMAT
> > END
> > IF @.Weekday=1
> > BEGIN
> > BACKUP DATABASE DIFFBACKUP
> > TO DISK ='F:\BackUp\DIFFBACKUPBACKUP.DAT' WITH INIT ,
> > NOUNLOAD , NAME = N'DIFFBACKUPBACKUP', NOSKIP ,
> > STATS = 10, NOFORMAT
> > END
> >
> > Please help.i am unable to identify the problem.
> >
> > thanks,
> > reddy.
> >
> >
> >
> >
> >
>
>

Friday, March 9, 2012

Differential Backup

I have the following scheduled for backup:
a) Full back up (daily) which creates a *.bak of 1.5GB in
size.
b) Transaction log (every 2 hours) which creates a *.TRN
of 20 MB
c) Differential back up which creates a *.bak of 9GB and
continues to grow.
Couple of questions:
1) Is the size normal for Differential? What am I doing
wrong? Why is it so big?
2) Is there only one file that gets created for
differential?
AKI wouldn't figure the differential should ever be larger than the full DB
backup. Is the differential backup writing to the same file each time? If so
then you're probably adding to the file each time, look up the WITH FORMAT
option of the BACKUP command.
Mike Kruchten
"AK" <anonymous@.discussions.microsoft.com> wrote in message
news:01bc01c3dc6d$25e70930$a401280a@.phx.gbl...
> I have the following scheduled for backup:
> a) Full back up (daily) which creates a *.bak of 1.5GB in
> size.
> b) Transaction log (every 2 hours) which creates a *.TRN
> of 20 MB
> c) Differential back up which creates a *.bak of 9GB and
> continues to grow.
>
> Couple of questions:
> 1) Is the size normal for Differential? What am I doing
> wrong? Why is it so big?
> 2) Is there only one file that gets created for
> differential?
>
> AK
>|||>--Original Message--
>I have the following scheduled for backup:
>a) Full back up (daily) which creates a *.bak of 1.5GB in
>size.
>b) Transaction log (every 2 hours) which creates a *.TRN
>of 20 MB
>c) Differential back up which creates a *.bak of 9GB and
>continues to grow.
>
>Couple of questions:
>1) Is the size normal for Differential? What am I doing
>wrong? Why is it so big?
>2) Is there only one file that gets created for
>differential?
>
Perhaps you are Apending the Differential file @. time you
run it. Try over writing the Differential @. time you run
it.
>AK
>
>.
>|||Mike:
Thank you for the reply!
It is backing up to same file every 4 hours.
I am not sure where you want me to check this statement? I
would appreciate some assistance on which tool to use?
The TRASNCT-SQL statement under the job is as follows
BACKUP DATABASE [Labor32SQL] TO DISK = N'D:\MSSQL7
\BACKUP\Labor32SQL\Labor32SQL Differential.BAK' WITH
NOINIT , NOUNLOAD , DIFFERENTIAL , NAME = N'Labor32SQL
Differential', NOSKIP , STATS = 10, NOFORMAT
Thank you very much!
AK
>--Original Message--
>I wouldn't figure the differential should ever be larger
than the full DB
>backup. Is the differential backup writing to the same
file each time? If so
>then you're probably adding to the file each time, look
up the WITH FORMAT
>option of the BACKUP command.
>Mike Kruchten
>
>"AK" <anonymous@.discussions.microsoft.com> wrote in
message
>news:01bc01c3dc6d$25e70930$a401280a@.phx.gbl...
>> I have the following scheduled for backup:
>> a) Full back up (daily) which creates a *.bak of 1.5GB
in
>> size.
>> b) Transaction log (every 2 hours) which creates a *.TRN
>> of 20 MB
>> c) Differential back up which creates a *.bak of 9GB and
>> continues to grow.
>>
>> Couple of questions:
>> 1) Is the size normal for Differential? What am I doing
>> wrong? Why is it so big?
>> 2) Is there only one file that gets created for
>> differential?
>>
>> AK
>>
>
>.
>|||How would I NOT append and rather overwrite?
Where would I set up this option?
I am running SQL 7.0
Thank you!
AK
>--Original Message--
>>--Original Message--
>>I have the following scheduled for backup:
>>a) Full back up (daily) which creates a *.bak of 1.5GB
in
>>size.
>>b) Transaction log (every 2 hours) which creates a *.TRN
>>of 20 MB
>>c) Differential back up which creates a *.bak of 9GB and
>>continues to grow.
>>
>>Couple of questions:
>>1) Is the size normal for Differential? What am I doing
>>wrong? Why is it so big?
>>2) Is there only one file that gets created for
>>differential?
>Perhaps you are Apending the Differential file @. time you
>run it. Try over writing the Differential @. time you run
>it.
>>AK
>>
>>.
>.
>|||You need to change the NOINIT/NOFORMAT statements, whats happening is the
backup is appended to the file each time. If you want to overwrite the
previous differential backup with the new one each time, drop the NOINIT and
NOFORMAT options and add FORMAT instead.
Mike Kruchten
"AK" <anonymous@.discussions.microsoft.com> wrote in message
news:09c201c3debc$01e8ae70$a401280a@.phx.gbl...
> Mike:
> Thank you for the reply!
> It is backing up to same file every 4 hours.
> I am not sure where you want me to check this statement? I
> would appreciate some assistance on which tool to use?
> The TRASNCT-SQL statement under the job is as follows
> BACKUP DATABASE [Labor32SQL] TO DISK = N'D:\MSSQL7
> \BACKUP\Labor32SQL\Labor32SQL Differential.BAK' WITH
> NOINIT , NOUNLOAD , DIFFERENTIAL , NAME = N'Labor32SQL
> Differential', NOSKIP , STATS = 10, NOFORMAT
>
> Thank you very much!
> AK
> >--Original Message--
> >I wouldn't figure the differential should ever be larger
> than the full DB
> >backup. Is the differential backup writing to the same
> file each time? If so
> >then you're probably adding to the file each time, look
> up the WITH FORMAT
> >option of the BACKUP command.
> >
> >Mike Kruchten
> >
> >
> >"AK" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:01bc01c3dc6d$25e70930$a401280a@.phx.gbl...
> >> I have the following scheduled for backup:
> >>
> >> a) Full back up (daily) which creates a *.bak of 1.5GB
> in
> >> size.
> >>
> >> b) Transaction log (every 2 hours) which creates a *.TRN
> >> of 20 MB
> >>
> >> c) Differential back up which creates a *.bak of 9GB and
> >> continues to grow.
> >>
> >>
> >> Couple of questions:
> >>
> >> 1) Is the size normal for Differential? What am I doing
> >> wrong? Why is it so big?
> >>
> >> 2) Is there only one file that gets created for
> >> differential?
> >>
> >>
> >> AK
> >>
> >>
> >
> >
> >.
> >

Differential Backup

I have the following scheduled for backup:
a) Full back up (daily) which creates a *.bak of 1.5GB in
size.
b) Transaction log (every 2 hours) which creates a *.TRN
of 20 MB
c) Differential back up which creates a *.bak of 9GB and
continues to grow.
Couple of questions:
1) Is the size normal for Differential? What am I doing
wrong? Why is it so big?
2) Is there only one file that gets created for
differential?
AKI wouldn't figure the differential should ever be larger than the full DB
backup. Is the differential backup writing to the same file each time? If so
then you're probably adding to the file each time, look up the WITH FORMAT
option of the BACKUP command.
Mike Kruchten
"AK" <anonymous@.discussions.microsoft.com> wrote in message
news:01bc01c3dc6d$25e70930$a401280a@.phx.gbl...
quote:

> I have the following scheduled for backup:
> a) Full back up (daily) which creates a *.bak of 1.5GB in
> size.
> b) Transaction log (every 2 hours) which creates a *.TRN
> of 20 MB
> c) Differential back up which creates a *.bak of 9GB and
> continues to grow.
>
> Couple of questions:
> 1) Is the size normal for Differential? What am I doing
> wrong? Why is it so big?
> 2) Is there only one file that gets created for
> differential?
>
> AK
>
|||
quote:

>--Original Message--
>I have the following scheduled for backup:
>a) Full back up (daily) which creates a *.bak of 1.5GB in
>size.
>b) Transaction log (every 2 hours) which creates a *.TRN
>of 20 MB
>c) Differential back up which creates a *.bak of 9GB and
>continues to grow.
>
>Couple of questions:
>1) Is the size normal for Differential? What am I doing
>wrong? Why is it so big?
>2) Is there only one file that gets created for
>differential?
>

Perhaps you are Apending the Differential file @. time you
run it. Try over writing the Differential @. time you run
it.
quote:

>AK
>
>.
>
|||Mike:
Thank you for the reply!
It is backing up to same file every 4 hours.
I am not sure where you want me to check this statement? I
would appreciate some assistance on which tool to use?
The TRASNCT-SQL statement under the job is as follows
BACKUP DATABASE [Labor32SQL] TO DISK = N'D:\MSSQL7
\BACKUP\Labor32SQL\Labor32SQL Differential.BAK' WITH
NOINIT , NOUNLOAD , DIFFERENTIAL , NAME = N'Labor32SQL
Differential', NOSKIP , STATS = 10, NOFORMAT
Thank you very much!
AK
quote:

>--Original Message--
>I wouldn't figure the differential should ever be larger

than the full DB
quote:

>backup. Is the differential backup writing to the same

file each time? If so
quote:

>then you're probably adding to the file each time, look

up the WITH FORMAT
quote:

>option of the BACKUP command.
>Mike Kruchten
>
>"AK" <anonymous@.discussions.microsoft.com> wrote in

message
quote:

>news:01bc01c3dc6d$25e70930$a401280a@.phx.gbl...
in[QUOTE]
>
>.
>
|||How would I NOT append and rather overwrite?
Where would I set up this option?
I am running SQL 7.0
Thank you!
AK
quote:

>--Original Message--
>
in[QUOTE]
>Perhaps you are Apending the Differential file @. time you
>run it. Try over writing the Differential @. time you run
>it.
>.
>
|||You need to change the NOINIT/NOFORMAT statements, whats happening is the
backup is appended to the file each time. If you want to overwrite the
previous differential backup with the new one each time, drop the NOINIT and
NOFORMAT options and add FORMAT instead.
Mike Kruchten
"AK" <anonymous@.discussions.microsoft.com> wrote in message
news:09c201c3debc$01e8ae70$a401280a@.phx.gbl...[QUOTE]
> Mike:
> Thank you for the reply!
> It is backing up to same file every 4 hours.
> I am not sure where you want me to check this statement? I
> would appreciate some assistance on which tool to use?
> The TRASNCT-SQL statement under the job is as follows
> BACKUP DATABASE [Labor32SQL] TO DISK = N'D:\MSSQL7
> \BACKUP\Labor32SQL\Labor32SQL Differential.BAK' WITH
> NOINIT , NOUNLOAD , DIFFERENTIAL , NAME = N'Labor32SQL
> Differential', NOSKIP , STATS = 10, NOFORMAT
>
> Thank you very much!
> AK
>
> than the full DB
> file each time? If so
> up the WITH FORMAT
> message
> in

Wednesday, March 7, 2012

different results in query analyzer and .net

ok the following statement returns the correct results in sql query analyzer but in the .net environment with c# it returns back less 3 records

SELECT SUM(ao.amount),bl.dpc,bl.city from billinglocation bl
inner join shippinglocation sl on bl.billinglocationid = sl.billinglocationid
inner join absorbentorder ao on sl.shippinglocationid = ao.shippinglocationid
group by bl.dpc, bl.city

billinglocation 1 - 1 shippinglocation 1 - many absorbentorder

anybody have any ideas why this might be occuring
thanks!

are you connecting to the right database?|||If you are receiving different results then you are not running the exact same thing. Are there any parameters involved? As Dinakar asked, are you sure you are running the query against the same database? We are probably going to need to see your C# code in order to be of any real help.

Saturday, February 25, 2012

different mdac, different sql server behaviour

I have done a partial conversion of a large MS Access batch processing
program to use a SQL server 2000 back end.
All I have done is move all the access tables in to SQL server and
give them primary keys so that tje Access front end can attach to them
as updateable tables. No pass thru queries or anything that will take
advantage of the SQL facilities.
In my development environment I am running Access 97 on Windows 98.
The client is running Access 97 on Windows XP
I am seeing different behaviour between my environment and the clients
environment - with exactly the same data sitting on the back end SQL
databases and exactly the same Access 97 front end.
I have managed to knock all the bugs out of the program when it runs
in my environment - but in their environment we are still seeing the
dreaded "Record is Deleted" message - seems to occur in some
situations where I use an outer join and attempt to pick up a value
from a field in the non existent record side of the join.
QUESTION - presumably the discrepancies are caused by us running
different versions of MDAC
1) can anyone tell me where I can download that utility that tells you
which version of mdac you are running
2) which part of mdac am I using when access attaches to the SQL back
end but all the work is still being done by the access front end ?
ole db server for Access ? odbc driver for SQL, jet ?
Many thanks
TonyHi
I am not an expert in this but..
> QUESTION - presumably the discrepancies are caused by us running
> different versions of MDAC
> 1) can anyone tell me where I can download that utility that tells you
> which version of mdac you are running
Down load the component check from
http://msdn.microsoft.com/data/mdac/default.aspx
> 2) which part of mdac am I using when access attaches to the SQL back
> end but all the work is still being done by the access front end ?
>
As you are not using passthru queries you may be doing most of the work at
the front end. You will be using the Jet engine to connect to your access
database and (probably) the oledb driver for SQL Server to connect to the
server (unless you are doing it though ODBC).
> ole db server for Access ? odbc driver for SQL, jet ?
> Many thanks
> Tony
John|||(1) MDAC Component Checker
http://www.microsoft.com/downloads/details.aspx?FamilyID=8f0a8df6-4a21-4b43-bf53-14332ef092c9&displaylang=en
(2) I would guess that you are using the ODBC driver, but I don't know. How
did you set up the link to SQL Server in the first place?
--
Keith
<ace join_to ware@.iinet.net.au (Tony Epton)> wrote in message
news:41c9a201.57817078@.news.m.iinet.net.au...
> I have done a partial conversion of a large MS Access batch processing
> program to use a SQL server 2000 back end.
> All I have done is move all the access tables in to SQL server and
> give them primary keys so that tje Access front end can attach to them
> as updateable tables. No pass thru queries or anything that will take
> advantage of the SQL facilities.
> In my development environment I am running Access 97 on Windows 98.
> The client is running Access 97 on Windows XP
> I am seeing different behaviour between my environment and the clients
> environment - with exactly the same data sitting on the back end SQL
> databases and exactly the same Access 97 front end.
> I have managed to knock all the bugs out of the program when it runs
> in my environment - but in their environment we are still seeing the
> dreaded "Record is Deleted" message - seems to occur in some
> situations where I use an outer join and attempt to pick up a value
> from a field in the non existent record side of the join.
> QUESTION - presumably the discrepancies are caused by us running
> different versions of MDAC
> 1) can anyone tell me where I can download that utility that tells you
> which version of mdac you are running
> 2) which part of mdac am I using when access attaches to the SQL back
> end but all the work is still being done by the access front end ?
> ole db server for Access ? odbc driver for SQL, jet ?
> Many thanks
> Tony|||On Wed, 22 Dec 2004 17:24:03 -0000, "John Bell"
<jbellnewsposts@.hotmail.com> wrote:
>> 2) which part of mdac am I using when access attaches to the SQL back
>> end but all the work is still being done by the access front end ?
>You will be using the Jet engine to connect to your access
>database and (probably) the oledb driver for SQL Server to connect to the
>server (unless you are doing it though ODBC).
Here is the code snippet I am using (the SQL case) (many thanks for
previous assistance in this area)
I have never really understood which driver I am using in this code -
but would be nice to know if I am looking at mdac version issues.
Could I ask someone to please eyeball my code and tell me which part
of mdac is being used.
For this routine, in the SQL case, the paramter "AttachPath" holds the
server name and database name (eg
"DATABASE=WFimporterWork;SERVER=SQLTESTSVR2;")
- I am doing a DSNless connection
Many thanks
Tony
Sub AttachATable(AttachPath, TableName, AttachName, strDatabaseType,
varUid As Variant, varPwd As Variant)
Dim MyTableDef As TableDef
Set MyTableDef = currentDb().CreateTableDef()
Dim strConnect As String
Select Case strDatabaseType
Case "SQL"
strConnect = "ODBC;DRIVER={sql server};" & AttachPath
& "TABLE=" & TableName & ";Trusted_Connection=No;"
If IsNull(varUid) = False Then
strConnect = strConnect & "UID=" & varUid & ";"
End If
If IsNull(varPwd) = False Then
strConnect = strConnect & "PWD=" & varPwd & ";"
End If
MyTableDef.Connect = strConnect
MyTableDef.Attributes = dbAttachSavePWD
Case "MDB"
MyTableDef.Connect = ";DATABASE=" + AttachPath
AttachName = AttachName & "_mdb"
End Select
MyTableDef.SourceTableName = TableName
MyTableDef.Name = AttachName
currentDb().TableDefs.Append MyTableDef ' Attach table.
End Sub|||Hi
ODBC is part of MDAC and you are using the SQL Server ODBC driver.
John
<ace join_to ware@.iinet.net.au (Tony Epton)> wrote in message
news:41ca1245.86557359@.news.m.iinet.net.au...
> On Wed, 22 Dec 2004 17:24:03 -0000, "John Bell"
> <jbellnewsposts@.hotmail.com> wrote:
>
>> 2) which part of mdac am I using when access attaches to the SQL back
>> end but all the work is still being done by the access front end ?
>>You will be using the Jet engine to connect to your access
>>database and (probably) the oledb driver for SQL Server to connect to the
>>server (unless you are doing it though ODBC).
> Here is the code snippet I am using (the SQL case) (many thanks for
> previous assistance in this area)
> I have never really understood which driver I am using in this code -
> but would be nice to know if I am looking at mdac version issues.
> Could I ask someone to please eyeball my code and tell me which part
> of mdac is being used.
> For this routine, in the SQL case, the paramter "AttachPath" holds the
> server name and database name (eg
> "DATABASE=WFimporterWork;SERVER=SQLTESTSVR2;")
> - I am doing a DSNless connection
> Many thanks
> Tony
> Sub AttachATable(AttachPath, TableName, AttachName, strDatabaseType,
> varUid As Variant, varPwd As Variant)
> Dim MyTableDef As TableDef
> Set MyTableDef = currentDb().CreateTableDef()
> Dim strConnect As String
> Select Case strDatabaseType
> Case "SQL"
> strConnect = "ODBC;DRIVER={sql server};" & AttachPath
> & "TABLE=" & TableName & ";Trusted_Connection=No;"
> If IsNull(varUid) = False Then
> strConnect = strConnect & "UID=" & varUid & ";"
> End If
> If IsNull(varPwd) = False Then
> strConnect = strConnect & "PWD=" & varPwd & ";"
> End If
> MyTableDef.Connect = strConnect
> MyTableDef.Attributes = dbAttachSavePWD
> Case "MDB"
> MyTableDef.Connect = ";DATABASE=" + AttachPath
> AttachName = AttachName & "_mdb"
> End Select
> MyTableDef.SourceTableName = TableName
> MyTableDef.Name = AttachName
> currentDb().TableDefs.Append MyTableDef ' Attach table.
> End Sub

different mdac, different sql server behaviour

I have done a partial conversion of a large MS Access batch processing
program to use a SQL server 2000 back end.
All I have done is move all the access tables in to SQL server and
give them primary keys so that tje Access front end can attach to them
as updateable tables. No pass thru queries or anything that will take
advantage of the SQL facilities.
In my development environment I am running Access 97 on Windows 98.
The client is running Access 97 on Windows XP
I am seeing different behaviour between my environment and the clients
environment - with exactly the same data sitting on the back end SQL
databases and exactly the same Access 97 front end.
I have managed to knock all the bugs out of the program when it runs
in my environment - but in their environment we are still seeing the
dreaded "Record is Deleted" message - seems to occur in some
situations where I use an outer join and attempt to pick up a value
from a field in the non existent record side of the join.
QUESTION - presumably the discrepancies are caused by us running
different versions of MDAC
1) can anyone tell me where I can download that utility that tells you
which version of mdac you are running
2) which part of mdac am I using when access attaches to the SQL back
end but all the work is still being done by the access front end ?
ole db server for Access ? odbc driver for SQL, jet ?
Many thanks
Tony
Hi
I am not an expert in this but..

> QUESTION - presumably the discrepancies are caused by us running
> different versions of MDAC
> 1) can anyone tell me where I can download that utility that tells you
> which version of mdac you are running
Down load the component check from
http://msdn.microsoft.com/data/mdac/default.aspx

> 2) which part of mdac am I using when access attaches to the SQL back
> end but all the work is still being done by the access front end ?
>
As you are not using passthru queries you may be doing most of the work at
the front end. You will be using the Jet engine to connect to your access
database and (probably) the oledb driver for SQL Server to connect to the
server (unless you are doing it though ODBC).

> ole db server for Access ? odbc driver for SQL, jet ?
> Many thanks
> Tony
John
|||(1) MDAC Component Checker
http://www.microsoft.com/downloads/d...displaylang=en
(2) I would guess that you are using the ODBC driver, but I don't know. How
did you set up the link to SQL Server in the first place?
Keith
<ace join_to ware@.iinet.net.au (Tony Epton)> wrote in message
news:41c9a201.57817078@.news.m.iinet.net.au...
> I have done a partial conversion of a large MS Access batch processing
> program to use a SQL server 2000 back end.
> All I have done is move all the access tables in to SQL server and
> give them primary keys so that tje Access front end can attach to them
> as updateable tables. No pass thru queries or anything that will take
> advantage of the SQL facilities.
> In my development environment I am running Access 97 on Windows 98.
> The client is running Access 97 on Windows XP
> I am seeing different behaviour between my environment and the clients
> environment - with exactly the same data sitting on the back end SQL
> databases and exactly the same Access 97 front end.
> I have managed to knock all the bugs out of the program when it runs
> in my environment - but in their environment we are still seeing the
> dreaded "Record is Deleted" message - seems to occur in some
> situations where I use an outer join and attempt to pick up a value
> from a field in the non existent record side of the join.
> QUESTION - presumably the discrepancies are caused by us running
> different versions of MDAC
> 1) can anyone tell me where I can download that utility that tells you
> which version of mdac you are running
> 2) which part of mdac am I using when access attaches to the SQL back
> end but all the work is still being done by the access front end ?
> ole db server for Access ? odbc driver for SQL, jet ?
> Many thanks
> Tony
|||On Wed, 22 Dec 2004 17:24:03 -0000, "John Bell"
<jbellnewsposts@.hotmail.com> wrote:

>You will be using the Jet engine to connect to your access
>database and (probably) the oledb driver for SQL Server to connect to the
>server (unless you are doing it though ODBC).
Here is the code snippet I am using (the SQL case) (many thanks for
previous assistance in this area)
I have never really understood which driver I am using in this code -
but would be nice to know if I am looking at mdac version issues.
Could I ask someone to please eyeball my code and tell me which part
of mdac is being used.
For this routine, in the SQL case, the paramter "AttachPath" holds the
server name and database name (eg
"DATABASE=WFimporterWork;SERVER=SQLTESTSVR2;")
- I am doing a DSNless connection
Many thanks
Tony
Sub AttachATable(AttachPath, TableName, AttachName, strDatabaseType,
varUid As Variant, varPwd As Variant)
Dim MyTableDef As TableDef
Set MyTableDef = currentDb().CreateTableDef()
Dim strConnect As String
Select Case strDatabaseType
Case "SQL"
strConnect = "ODBC;DRIVER={sql server};" & AttachPath
& "TABLE=" & TableName & ";Trusted_Connection=No;"
If IsNull(varUid) = False Then
strConnect = strConnect & "UID=" & varUid & ";"
End If
If IsNull(varPwd) = False Then
strConnect = strConnect & "PWD=" & varPwd & ";"
End If
MyTableDef.Connect = strConnect
MyTableDef.Attributes = dbAttachSavePWD
Case "MDB"
MyTableDef.Connect = ";DATABASE=" + AttachPath
AttachName = AttachName & "_mdb"
End Select
MyTableDef.SourceTableName = TableName
MyTableDef.Name = AttachName
currentDb().TableDefs.Append MyTableDef ' Attach table.
End Sub
|||Hi
ODBC is part of MDAC and you are using the SQL Server ODBC driver.
John
<ace join_to ware@.iinet.net.au (Tony Epton)> wrote in message
news:41ca1245.86557359@.news.m.iinet.net.au...
> On Wed, 22 Dec 2004 17:24:03 -0000, "John Bell"
> <jbellnewsposts@.hotmail.com> wrote:
>
> Here is the code snippet I am using (the SQL case) (many thanks for
> previous assistance in this area)
> I have never really understood which driver I am using in this code -
> but would be nice to know if I am looking at mdac version issues.
> Could I ask someone to please eyeball my code and tell me which part
> of mdac is being used.
> For this routine, in the SQL case, the paramter "AttachPath" holds the
> server name and database name (eg
> "DATABASE=WFimporterWork;SERVER=SQLTESTSVR2;")
> - I am doing a DSNless connection
> Many thanks
> Tony
> Sub AttachATable(AttachPath, TableName, AttachName, strDatabaseType,
> varUid As Variant, varPwd As Variant)
> Dim MyTableDef As TableDef
> Set MyTableDef = currentDb().CreateTableDef()
> Dim strConnect As String
> Select Case strDatabaseType
> Case "SQL"
> strConnect = "ODBC;DRIVER={sql server};" & AttachPath
> & "TABLE=" & TableName & ";Trusted_Connection=No;"
> If IsNull(varUid) = False Then
> strConnect = strConnect & "UID=" & varUid & ";"
> End If
> If IsNull(varPwd) = False Then
> strConnect = strConnect & "PWD=" & varPwd & ";"
> End If
> MyTableDef.Connect = strConnect
> MyTableDef.Attributes = dbAttachSavePWD
> Case "MDB"
> MyTableDef.Connect = ";DATABASE=" + AttachPath
> AttachName = AttachName & "_mdb"
> End Select
> MyTableDef.SourceTableName = TableName
> MyTableDef.Name = AttachName
> currentDb().TableDefs.Append MyTableDef ' Attach table.
> End Sub