You are here: Re: On to Bulk Insert issues « MsSQL Server « IT news, forums, messages
Re: On to Bulk Insert issues

Posted by Ted on 08/08/06 22:38

Erland Sommarskog wrote:
> Ted (r.ted.byers@rogers.com) writes:
> > To deal with the quotes (because your example doesn't show what happens
> > if the first column in the file is quoted text), I tried the data
> > import wizard from within SQL Server Management Studio. For most of
> > the data files/table combinations, it worked well. However, there are
> > issues, especially related to nulls.
>
> Wait a minute, last night you were using BULK INSERT, now you are using
> the Import Wizard which uses SQL Integration Services that I know next
> to nothing about. So I cannot assist with that part.
>
Actually, I have been experimenting with BULK INSERT, bcp, and the
import wizard simultaneously. I find some inconsistency in how they
work. With bulk insert, it seems I can tell it to preserve my nulls,
and I haven't found out how to do that with the wizard (which is
accessable in SQL Server Management Studio by selecting the database
and then, from the popup menu selecting either import data or export
data).

OTOH, the wizard lets me specify in the second dialog that the text
fields are enclosed by quotes while it seems I may be only able to do
that by creating a format file for use by bcp or bulk insert.

> > 4) Each time I tried the wizard, I told it to store a package on the
> > server. However, I can't seem to find these packages. Where should I
> > be looking for them, and can I tell SQL Server Management Studio to
> > export the packages as scripts I can invokve from the commandline?
>
> As I understand it, Mgmt Studio does not offer any interface to
> Integration Services. To this end you should use Business Intelligence
> Development Studio.
>
It is accessable in Mgmt Studio through the popup menu accessible on
each database on the server.

> > I solved the problem with errors (item #1 in my previous post) by more
> > carefully specifying the data type of the input file columns. But this
> > leads to an equally serious problem. All the nulls in that column are
> > silently converted into zero.
>
> Just a stupid check: you don't happen to have a default of 0 on those
> columns.
>
No. On that particular table, there are no default values.

Thanks

Ted

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация