473,320 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Data conversion

I have a series of excel sheets from which i am converting data into our SQL 2008 database. Some of the fields in the excel files provided by the customer contain fields that are varchar(3). One example is that these describe "skin tone", and include abbreviations such as "DRK", "PAL", "RUD", etc. in our database, these fields are bit fields, with one for each description. I am assuming that, in order to convert these, a case expression needs to be composed, but i am unclear as to the syntax to be used in this situation. Any help is appreciated.
Sep 27 '11 #1
3 1146
Rabbit
12,516 Expert Mod 8TB
Yes, you would need a case statement for each bit field you want to set. However, the current design is poor. It really should be set up the way the excel spreadsheet is set up, it makes for easier querying.
Sep 27 '11 #2
so my question is really this....what would that case expression actually look like?
Sep 27 '11 #3
Rabbit
12,516 Expert Mod 8TB
If you choose not to normalize the data, then one of the case statements would look like this
Expand|Select|Wrap|Line Numbers
  1. CASE WHEN fieldName = 'BLK' THEN 1 ELSE 0 END
Sep 27 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Dillon Mantle | last post by:
HI All Does any one know how to convert a binary file into a readable (by human) file? Its from a bin file, has addresses and stuff which I can work out... but how do you do the actual...
1
by: Tim | last post by:
I am researching a potential solution for my company. Currently we convert a new client's dataset into our own data structures using Fox Pro and then Sql (Our data is in SQL). There are a lot of...
6
by: New MSSQL DBA | last post by:
Hi all, we are now planning to upgrade our application from a non-unicode version to a unicode version. The application's backend is a SQL Server 2000 SP3. The concern is, existing business...
6
by: Ecohouse | last post by:
I have a field in a recordset which is a string. It can look like this: 13-15-67-56 I need to break out this string into numbers to run in queries to open recordsets. But when I try to open...
0
by: SerbianEagle | last post by:
Hello. I've just joined this forum as I've been searching for some advice with a data conversion that I have to do. Using : MS SQL server 2000 Old DB: many tables and no relationships...
0
by: ipoxygen | last post by:
Hi, I do have 6 identical tables on six different databases (same server). I would like to merge them into one single table for reporting purposes. For the majority of the table it does work...
7
by: girl | last post by:
Hi i have a problem with MS SQL server 2000 and hope to seek for some advise. i have the following samples aa|0|abcdefg| b|0|abcdefg| i used the bulk insert in the query analyser.. BULK...
1
by: Javilen | last post by:
Hello, edit: added some more info I am trying to set up a job to run a SSIS package in SQL 2005, the SQL 2005 is installed on a Windows server 2003 machine. start Edit I have the...
0
by: dataentryoffshore | last post by:
Get a Discount up to 60% on data entry, data capture, dataentry services, large volume data processing and data conversion services through offshore facilities in India. Offshore data entry also...
2
by: dowlingm815 | last post by:
Hi, In the following code, i keep getting a data conversion error at the fund field. In the code below, it takes data from a query and creates a table. It is a six digit alpha field within the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.