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
 Import/Export (DTS) and Replication (2000)
 conversion to varchar

Author  Topic 

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2004-06-17 : 13:33:55
One column in excel spreadsheet when I import is varbinary and destination column in sql server is varchar.So please help me with this conversion

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-06-17 : 13:39:37
Just use CAST or CONVERT.

Tara
Go to Top of Page

sqllearner
Aged Yak Warrior

639 Posts

Posted - 2004-06-17 : 13:52:24
select convert(varchar(13), `'Rows 1 - 24233$'`.`emp_id`) as emp_id
from `'Rows 1 - 24233$'`
when I do this it gives an error...source is excel and the destination is sql server
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-06-17 : 13:54:37
What is the error?


First, put your data into a staging table that has the data types the same as the source. Then run T-SQL to move the database from the staging table to your destination table.

Tara
Go to Top of Page
   

- Advertisement -