Showing posts with label import. Show all posts
Showing posts with label import. Show all posts

Tuesday, March 20, 2012

Primary key and identity fields information got lost by "Import Da

Hi all!
I want to import data from Sql Server 2000 into Sql Server 2005.
When i select "Import Data" in 2005 and import tables directly from the 2000
Data Source, the primary keys and the identity fields information is lost in
2005.
Who knows why?
Best regards
Ulrich Schumacher
urlich
How about BACKUP /RESTORE commands
Or you can create a linked server to SQL Server 2000 and run SELECT * INTO
Schema.Mytable FROM SQL2K.Database.DBO.Table it ON SQL Server 2005
"ulrich schumacher" <ulrichschumacher@.discussions.microsoft.com> wrote in
message news:D20F7B7B-5C85-441B-AFE5-14191B3DF6CA@.microsoft.com...
> Hi all!
> I want to import data from Sql Server 2000 into Sql Server 2005.
> When i select "Import Data" in 2005 and import tables directly from the
> 2000
> Data Source, the primary keys and the identity fields information is lost
> in
> 2005.
> Who knows why?
> Best regards
> Ulrich Schumacher
>

Primary key and identity fields information got lost by "Import Da

Hi all!
I want to import data from Sql Server 2000 into Sql Server 2005.
When i select "Import Data" in 2005 and import tables directly from the 2000
Data Source, the primary keys and the identity fields information is lost in
2005.
Who knows why?
Best regards
Ulrich Schumacherurlich
How about BACKUP /RESTORE commands
Or you can create a linked server to SQL Server 2000 and run SELECT * INTO
Schema.Mytable FROM SQL2K.Database.DBO.Table it ON SQL Server 2005
"ulrich schumacher" <ulrichschumacher@.discussions.microsoft.com> wrote in
message news:D20F7B7B-5C85-441B-AFE5-14191B3DF6CA@.microsoft.com...
> Hi all!
> I want to import data from Sql Server 2000 into Sql Server 2005.
> When i select "Import Data" in 2005 and import tables directly from the
> 2000
> Data Source, the primary keys and the identity fields information is lost
> in
> 2005.
> Who knows why?
> Best regards
> Ulrich Schumacher
>

Primary key and identity fields information got lost by "Import Da

Hi all!
I want to import data from Sql Server 2000 into Sql Server 2005.
When i select "Import Data" in 2005 and import tables directly from the 2000
Data Source, the primary keys and the identity fields information is lost in
2005.
Who knows why?
Best regards
Ulrich Schumacherurlich
How about BACKUP /RESTORE commands
Or you can create a linked server to SQL Server 2000 and run SELECT * INTO
Schema.Mytable FROM SQL2K.Database.DBO.Table it ON SQL Server 2005
"ulrich schumacher" <ulrichschumacher@.discussions.microsoft.com> wrote in
message news:D20F7B7B-5C85-441B-AFE5-14191B3DF6CA@.microsoft.com...
> Hi all!
> I want to import data from Sql Server 2000 into Sql Server 2005.
> When i select "Import Data" in 2005 and import tables directly from the
> 2000
> Data Source, the primary keys and the identity fields information is lost
> in
> 2005.
> Who knows why?
> Best regards
> Ulrich Schumacher
>

Monday, March 12, 2012

Primary Key

HI, im tying to import data in a table from my AS400 the transfer is fine but
when i want to set a primary key to do relationship it keep telling me that I
have duplicate key how can I remove the duplicate key.
Thanks!
O i forgot im a reel dummies in SQL2000
INF: How to Remove Duplicate Rows From a Table
http://support.microsoft.com/default...b;en-us;139444
AMB
"Jean-Francois" wrote:

> HI, im tying to import data in a table from my AS400 the transfer is fine but
> when i want to set a primary key to do relationship it keep telling me that I
> have duplicate key how can I remove the duplicate key.
> Thanks!
> O i forgot im a reel dummies in SQL2000

Primary Key

HI, im tying to import data in a table from my AS400 the transfer is fine but
when i want to set a primary key to do relationship it keep telling me that I
have duplicate key how can I remove the duplicate key.
Thanks!
O i forgot im a reel dummies in SQL2000INF: How to Remove Duplicate Rows From a Table
http://support.microsoft.com/default.aspx?scid=kb;en-us;139444
AMB
"Jean-Francois" wrote:
> HI, im tying to import data in a table from my AS400 the transfer is fine but
> when i want to set a primary key to do relationship it keep telling me that I
> have duplicate key how can I remove the duplicate key.
> Thanks!
> O i forgot im a reel dummies in SQL2000

Primary Key

HI, im tying to import data in a table from my AS400 the transfer is fine bu
t
when i want to set a primary key to do relationship it keep telling me that
I
have duplicate key how can I remove the duplicate key.
Thanks!
O i forgot im a reel dummies in SQL2000INF: How to Remove Duplicate Rows From a Table
http://support.microsoft.com/defaul...kb;en-us;139444
AMB
"Jean-Francois" wrote:

> HI, im tying to import data in a table from my AS400 the transfer is fine
but
> when i want to set a primary key to do relationship it keep telling me tha
t I
> have duplicate key how can I remove the duplicate key.
> Thanks!
> O i forgot im a reel dummies in SQL2000

primary filegroup is full?

Hi,
I'm trying to use DTS to import a text file into a table and I get an error
saying that space cannot be allocated for the file because the primary
filegroup is full.
Any ideas how to extend the primary filegroup?
thanksRafale
It looks like during the DTS's execution an autogrow feature kicks in and
it takes some time
Check it out if you have enough available space and try to import the data
with small tranasctions.
"Rafael Chemtob" <rchemtobb@.nospam.yahoo.com> wrote in message
news:%236fCfYeOFHA.244@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm trying to use DTS to import a text file into a table and I get an
error
> saying that space cannot be allocated for the file because the primary
> filegroup is full.
> Any ideas how to extend the primary filegroup?
> thanks
>|||Yes I hit the same deal a few years ago try to shrink the files and the
tran log in that does not work then you need more hard disk space. aka
another disk drive or nas
*** Sent via Developersdex http://www.examnotes.net ***|||Hi,
Looks like any one of the below 3 reasons had created this error:-
1. You have restricted the file growth
2. Transaction log (LDF) has gone high due to DTS
3. Not enough room in hard disk
The solutions for each of the above problems are:-
1. Remove the restricted growth and monitor the growth while DTS
2. Take Transaction log backup and shrink the LDF file. See Backup LOG and
DBCC SHRINKFILE commands in books online. After shrink start the
DTS
3. Add a new file (NDF) and put it in a hard disk drive where u have more
space and start DTS
Thanks
Hari
SQL Server MVP
"Rafael Chemtob" <rchemtobb@.nospam.yahoo.com> wrote in message
news:%236fCfYeOFHA.244@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm trying to use DTS to import a text file into a table and I get an
> error
> saying that space cannot be allocated for the file because the primary
> filegroup is full.
> Any ideas how to extend the primary filegroup?
> thanks
>

Monday, February 20, 2012

Preventing invalid data from being entered

Hi,

I need to be able to prevent an invalid character from being entered into a sql 2000 databae on import from oracle.

In short, I need to exclude a certain character from being entered and need to be able to send an email which specifies that an attempt was made to enter this character, if the change was due to an insert or an update, the row to be affected in the target database, date and time info. Also the source of the data.

If this is not possible, is it viable to remove the character after insert and still send the email withe the required info?

Any one any ideas on the cleanest way to achieve this?

Thanks

Hi,

you could use a trigger for that. Check the incoming values for information about special character and put in a auditing record in another table (sending EMails from triggers is not suggested as it runs in the same transaction and can slow down your system or break your code). So a sample for doing this would be the following:

--Check the triggernestlevel to ensure that the trigger does not call an infinite loop
BEGIN TRANSACTION

INSERT INTO AuditTable
SELECT TheColumns
FROM INSERTED
WHERE CHARINDEX(SomeColumn,'SomeChartoExclude') > 0

--Then either Replace the Value or do something else
UPDATE SomeTable
SET SomeColumn = REPLACE(SomeColumn, 'SomeChartoExclude','ReplacedChar')
INNER JOIN INSERTED
ON I.PrimaryKeyCol 0 S.PrimaryKeyCol
WHERE CHARINDEX(SomeColumn,'SomeChartoExclude') > 0

COMMIT

In addition put error handling in your trigger if you want to catch the error that might occur.

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de