dbTalk Databases Forums  

Table size too large when importing from text file

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Table size too large when importing from text file in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Vlad Kozlovsky
 
Posts: n/a

Default Table size too large when importing from text file - 10-14-2004 , 12:05 PM






I am having a weird problem when I try to import a text file into SQL Server
2000 using DTS. Only happens I import into an existing table that has various
field types, such as nvarchar, float, decimal, datetime, etc., as appropriate
for each field. After the import, the table size on disk is VERY large. Where
the source file is about 60 mb, for example, the resulting SQL table is 19
gb! This does not happen if I simply import into a table where all fields are
nvarchar(8000) and then do the conversion inside SQL Server. When I look at
the resulting table, it looks normal -- just takes up way too much space on
disk.

What am I missing?! Thanks!

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Table size too large when importing from text file - 10-14-2004 , 01:40 PM






Is the table simply fragmented? DBCC SHOWCONTIG()

How are you arriving at the table size?

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"Vlad Kozlovsky" <VladKozlovsky (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am having a weird problem when I try to import a text file into SQL
Server
2000 using DTS. Only happens I import into an existing table that has
various
field types, such as nvarchar, float, decimal, datetime, etc., as
appropriate
for each field. After the import, the table size on disk is VERY large.
Where
the source file is about 60 mb, for example, the resulting SQL table is 19
gb! This does not happen if I simply import into a table where all fields
are
nvarchar(8000) and then do the conversion inside SQL Server. When I look
at
the resulting table, it looks normal -- just takes up way too much space
on
disk.

What am I missing?! Thanks!



Reply With Quote
  #3  
Old   
Vlad Kozlovsky
 
Posts: n/a

Default Re: Table size too large when importing from text file - 10-14-2004 , 02:21 PM



I am looking at "Table Info" tab in Taskpad. I also checked the size of the
physical .MDF file.

Importing 172000 records took about 1 hour and increased MDF file size by 19
GB. This is on a new Itanuim-2 box with 64 GB RAM and a super-fast SAN.

Thanks for showcontig tip.


"Allan Mitchell" wrote:

Quote:
Is the table simply fragmented? DBCC SHOWCONTIG()

How are you arriving at the table size?

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Table size too large when importing from text file - 10-14-2004 , 02:29 PM



When importing then people tend to remove indexes.

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"Vlad Kozlovsky" <VladKozlovsky (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am looking at "Table Info" tab in Taskpad. I also checked the size of the
physical .MDF file.

Importing 172000 records took about 1 hour and increased MDF file size by
19
GB. This is on a new Itanuim-2 box with 64 GB RAM and a super-fast SAN.

Thanks for showcontig tip.


"Allan Mitchell" wrote:

Is the table simply fragmented? DBCC SHOWCONTIG()

How are you arriving at the table size?

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com




Reply With Quote
  #5  
Old   
Vlad Kozlovsky
 
Posts: n/a

Default Re: Table size too large when importing from text file - 10-14-2004 , 02:33 PM



This table has no indexes.


"Allan Mitchell" wrote:

Quote:
When importing then people tend to remove indexes.

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com



Reply With Quote
  #6  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Table size too large when importing from text file - 10-14-2004 , 02:37 PM



Make sure that the bloat is not in the log.

Add a CI to the table.

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"Vlad Kozlovsky" <VladKozlovsky (AT) discussions (DOT) microsoft.com> wrote

Quote:
This table has no indexes.


"Allan Mitchell" wrote:

When importing then people tend to remove indexes.

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com





Reply With Quote
  #7  
Old   
Ilya Margolin
 
Posts: n/a

Default Re: Table size too large when importing from text file - 10-15-2004 , 07:28 AM



Vlad,

What is the growth option for the database?

Ilya

"Vlad Kozlovsky" <VladKozlovsky (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am having a weird problem when I try to import a text file into SQL
Server
2000 using DTS. Only happens I import into an existing table that has
various
field types, such as nvarchar, float, decimal, datetime, etc., as
appropriate
for each field. After the import, the table size on disk is VERY large.
Where
the source file is about 60 mb, for example, the resulting SQL table is 19
gb! This does not happen if I simply import into a table where all fields
are
nvarchar(8000) and then do the conversion inside SQL Server. When I look
at
the resulting table, it looks normal -- just takes up way too much space
on
disk.

What am I missing?! Thanks!



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.