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 2005 Forums
 SQL Server Administration (2005)
 Trim on bulk insert

Author  Topic 

sanjnep
Posting Yak Master

191 Posts

Posted - 2007-09-25 : 11:34:48
For a bulk insert is there a way to trim the data that comes in with a fixed length of say 45 characters but only 14 used and the rest is all spaces?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-09-25 : 12:05:21
Just bulk insert the data into a staging table, then use T-SQL to move the data into your real table.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -