|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Can you apply functions while loading data?HI there,
I'm interested in whether or not BCP can apply to functions to data while loading. For example, I am loading source data that has several decimal places (more than is defined in the table). Currently (with MSSQL 2000) the decimals are just truncated to the appropriate number of decimal places. I want to ROUND the source data. Is there an easy way to achieve this? Short of just widening the table and rounding afterwards of course :) Thanks in advance -- DK Dwayne King (dwayne.k***@cognos.com) writes:
> I'm interested in whether or not BCP can apply to functions to data while No, BCP can't do this. > loading. > > For example, I am loading source data that has several decimal places > (more than is defined in the table). Currently (with MSSQL 2000) the > decimals are just truncated to the appropriate number of decimal places. > I want to ROUND the source data. > > Is there an easy way to achieve this? Short of just widening the table > and rounding afterwards of course :) I would guess that DTS/SSIS are able to do this, but I don't know them. (DTS is in SQL 2000. SSIS, SQL Server Integration Services, is the successor in SQL 2005.) -- Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx |
|||||||||||||||||||||||