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
 Transact-SQL (2005)
 Select Data From Excel

Author  Topic 

sross81
Posting Yak Master

228 Posts

Posted - 2008-05-22 : 14:32:54
Hello,

Is there a good way in SQL to select records that have been sent in an excel spreadsheet and import them into a temporary table?

I have a list of order codes that have different seg codes for example:

Order Code ZSeg
7625 ZBL
717009 ZBL
3277 ZCI
8144 ZCI

Each order code is unique and is classifed into a zseq. Depending on this zseg I need to update an existing table with the following field names and values for each order code:

For example for an order code classified as a ZBL I need to insert into an existing table that uses order code as the PK

Value Code: Patrac
Value Description: Patient Race
Value Type: ST
Units: None
Template Name: Lab_Master_
Field Name: AOE_BL_Race

There are multiple Value codes for each Zseg that will be inserted for each order code.

Can someone tell me the best way to do something like this?




visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-22 : 14:41:20
You can use OPENROWSET function or SSIS Export/Import wizard etc. See below link

http://www.mssqltips.com/tip.asp?tip=1207
Go to Top of Page
   

- Advertisement -