appropriate values. Then if the DTS package just references the other 3
columns in the insert it will fill them in with the defaults. If your
you have to use a transform in the package or add it into the query. You
Andrew J. Kelly SQL MVP
"Rich" <Rich@discussions.microsoft.com> wrote in message
news:DD5C8224-92FE-4745-9DE2-F6C3AD49328E@microsoft.com...
> Hello Andrew,
> yes I am using DTS. I suspect that placing some default data such as a
> zero
> or a space in the field which is appropriate is my only option. If the
> field
> is set for NOT NULL, you just have to place something there.
>
> "Andrew J. Kelly" wrote:
>
>> How are you migrating the data? If you use DTS or SSIS you can simply
>> add
>> spaces and a 0 for those two columns.
>>
>> --
>> Andrew J. Kelly SQL MVP
>>
>>
>> "Rich" <Rich@discussions.microsoft.com> wrote in message
>> news:18C5868C-189E-4D47-85AB-D83D81FCF901@microsoft.com...
>> > Hello Andrew,
>> >
>> > 1) sure, going forward as records come into this "store bought
>> > application"
>> > the fields will be filled with whatever the frontend places into them.
>> > 2) for now, I have to migrate what little data is in the old system to
>> > this
>> > new one and most of the fields do not map. The data just is not in the
>> > old
>> > system.
>> > 3) I thought I had seen some place that CTRL-ZERO was empty but I have
>> > not
>> > been able to verify that, besides, how could I place that in the insert
>> > query
>> > when I migrate all of the old data anyway?
>> >
>> > Rich
>> >
>> > "Andrew J. Kelly" wrote:
>> >
>> >> You see that is the whole point of declaring a column NOT NULL. It
>> >> means
>> >> you must put something into it. If the business rules state these
>> >> columns
>> >> must have valid data then you need to provide that data. If it doesn't
>> >> matter you should either not declare them as NOT NULL or provide a
>> >> DEFAULT
>> >> Constraint for these two columns. The question is what should the
>> >> default
>> >> value be? That is something I can't say since this is your db and
>> >> your
>> >> business rules will dictate that. But if there are no business rules
>> >> and
>> >> other applications aren't expecting something specific here you can
>> >> make
>> >> the
>> >> default of ten spaces for the IP address and 0 for the HopID. But my
>> >> guess
>> >> is this will break something else.
>> >>
>> >> --
>> >> Andrew J. Kelly SQL MVP
>> >>
>> >>
>> >> "Rich" <Rich@discussions.microsoft.com> wrote in message
>> >> news:13C578C9-C1A1-4B20-9158-2638622252BC@microsoft.com...
>> >> > Hello Tom,
>> >> >
>> >> > old data to be inserted:
>> >> >
>> >> > RecordID Date Comments
>> >> > -------------------------------------------------------------------
>> >> > 1 1/1/2006 From New
>> >> > York
>> >> > see log
>> >> > 2 1/2/2006 Ohio was
>> >> > not
>> >> > on
>> >> > line see log
>> >> > 3 3/10/2006 Ohio
>> >> > connection
>> >> > lost see log
>> >> >
>> >> > This is the new table that will except the data:
>> >> >
>> >> > recordID IPAddress HopID Date Comments
>> >> >
>> >> > [recordID] [int] NOT NULL ,
>> >> > [IPAddress] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
>> >> > NULL ,
>> >> > [HopID] [int] NOT NULL ,
>> >> > [Date] [datetime] NOT NULL ,
>> >> > [Comments] [char] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
>> >> > NULL
>> >> >
>> >> > Notice I have two extra fields that in the new database which
>> >> > willnot
>> >> > except
>> >> > nulls. My question was how do I insert empty into a field which
>> >> > will
>> >> > not
>> >> > except a null?
>> >> >
>> >> > +++++++++++++++++++++++++++
>> >> >
>> >> >
>> >> > "Tom Moreau" wrote:
>> >> >
>> >> >> Please post your DDL and some sample data.
>> >> >>
>> >> >> --
>> >> >> Tom
>> >> >>
>> >> >> ----------------------------------------------------
>> >> >> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
>> >> >> SQL Server MVP
>> >> >> Columnist, SQL Server Professional
>> >> >> Toronto, ON Canada
>> >> >>
www.pinpub.com >> >> >> ..
>> >> >> "Rich" <Rich@discussions.microsoft.com> wrote in message
>> >> >> news:6850B12D-C371-481D-86ED-EF010C3D54A3@microsoft.com...
>> >> >> Hello Group,
>> >> >>
>> >> >> yes new to sql. I was given the task of moving some old data to a
>> >> >> brand
>> >> >> new
>> >> >> application the company just bought. I see that the new
>> >> >> application
>> >> >> database
>> >> >> has several fields that have the attribute of not being able to
>> >> >> have a
>> >> >> null.
>> >> >> Some of the fields are number and some are alpha.
>> >> >>
>> >> >> My question is how do I insert the old data into the new tables and
>> >> >> on
>> >> >> the
>> >> >> fields which cannot take the NULL, insert nothing? Using a space
>> >> >> does
>> >> >> not
>> >> >> work.
>> >> >>
>> >> >> Rich
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>