Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Copy Data with different datatype

Author  Topic 

hammadrasheed
Starting Member

3 Posts

Posted - 2011-07-20 : 03:05:42
Hello;
i have a situation. i have Microsoft access files (Branchdb :) which I got from the branches, now I need to copy these file’s data into the SQL table named: ‘AllBranchesData’.
Microsoft Access file has the field which are mentioned below:

Branchdb:
=======================================================
Field Name Data Type
=======================================================
• MM Number
• YY Number
• ACode Number
• BookNo Text
• Invoice Number
• CCode Number
• PCode Text
• TDate Date/Time

AllBranchesData:

===========================================================
Field Name Data Type
===========================================================
• MM decimal
• YY decimal
• ACode decimal
• BookNo nvarchar
• Invoice decimal
• CCode decimal
• PCode nvarchar
• TDate datetime
• TQty decimal
• Bal int
• Amt float
Now when I am trying to copy data from Branchdb to AllBranchesData than it gives error about the data types mismatch, some data will loss if I continue to copy data.
Is there is a way to copy all the data in AllBranchesData using any query.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2011-07-20 : 03:24:37
Is this a SQL Server question or a Access question?



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

hammadrasheed
Starting Member

3 Posts

Posted - 2011-07-20 : 06:16:00
its a sql question... i want to know the why through which we can handle this problem
Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2011-07-20 : 07:21:21
I think you are only seeing a warning, since the Access Text datatype can store up to 255 characters. If your nvarchar fields are defined with a size of less than 255, then you may see truncation of data. Make sure your nvarchar fields are wide enough to support the data coming from Access.

OS
Go to Top of Page
   

- Advertisement -