export/import script

I need to import an excel sheet data (filename.xls) into a sql server db table. I have imported the sheet data into db table named filename#. Now I need to import data in filename# table into table myDestTable (which has an identity PK column.) Due to some column data type differences between the two tables, I have to write a tsql script using
Insert into ...
select ...

Are there any importing scripts samples, especially taking care of data type differences and indetity column, and etc. ?

Thanks.
LVL 1
minglelinchAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vikas GargBusiness Intelligence DeveloperCommented:
Hi,

Fried there is nothing which can help you except you.

Since the source and destination table must have same data type or you need to cast / Convert according to the destination table datatype.

That is the simplest you can do.

Just check the data type of destination table and convert source data to match up with it
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
minglelinchAuthor Commented:
Thanks for the post.
0
Harish VargheseProject LeaderCommented:
You may use import wizard in SQL server management studio to take care of data type conversions automatically (wherever possible).
0
minglelinchAuthor Commented:
I did it this way but failed on conversion.
0
Harish VargheseProject LeaderCommented:
SSIS is the way then. You can have explicit type conversions.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.