Click here to Skip to main content
15,926,174 members
Home / Discussions / Database
   

Database

 
QuestionConnecting to SQL problem ! Pin
mrkeivan26-Apr-07 20:37
mrkeivan26-Apr-07 20:37 
AnswerRe: Connecting to SQL problem ! Pin
Sathesh Sakthivel26-Apr-07 21:04
Sathesh Sakthivel26-Apr-07 21:04 
GeneralRe: Connecting to SQL problem ! Pin
mrkeivan27-Apr-07 0:10
mrkeivan27-Apr-07 0:10 
AnswerRe: Connecting to SQL problem ! Pin
Pete O'Hanlon27-Apr-07 0:59
mvePete O'Hanlon27-Apr-07 0:59 
GeneralRe: Connecting to SQL problem ! Pin
mrkeivan28-Apr-07 10:05
mrkeivan28-Apr-07 10:05 
GeneralRe: Connecting to SQL problem ! Pin
mrkeivan29-Apr-07 7:28
mrkeivan29-Apr-07 7:28 
AnswerRe: Connecting to SQL problem ! Pin
Pete O'Hanlon30-Apr-07 22:30
mvePete O'Hanlon30-Apr-07 22:30 
QuestionSelecting numeric data from varchar string Pin
LobsterHead26-Apr-07 15:56
LobsterHead26-Apr-07 15:56 
Hey everyone! I'm a little stumped on a problem with some SQL code that I'm writing, so I was hoping someone might be able to offer some advice.

I have a varchar column on a table in which I record the id_keys of another table. Sometimes multiple id_keys are entered into the column, which we format as: 1; 2; 3, with each id_key seperated from the previous one by a semicolon with a space (; ). What I'm trying to do is to write an update statement that will pull the numeric values of the id_keys out of the varchar string, and then match them up to the id_keys of the first table. This is the basic statement I've got so far:

UPDATE TABLE1

SET column1 = a.column1,
column2 = a.column2

FROM TABLE2 a

WHERE TABLE1.id_key = (
SELECT column3
FROM TABLE2)

Column3 is the column that would have the varchar string containing the id_keys of TABLE1. Obviously, simply doing a SELECT statement on column3 won't be sufficient, but I'm not sure how to write my SQL code to give me the data I need. I suspect that I'll also have to convert the data back to numeric from varchar, but I haven't got that far yet.

Any thoughts or suggestions? Thanks everyone!
AnswerRe: Selecting numeric data from varchar string Pin
N a v a n e e t h26-Apr-07 21:33
N a v a n e e t h26-Apr-07 21:33 
GeneralRe: Selecting numeric data from varchar string Pin
LobsterHead27-Apr-07 7:34
LobsterHead27-Apr-07 7:34 
AnswerRe: Selecting numeric data from varchar string Pin
Paddy Boyd27-Apr-07 6:10
Paddy Boyd27-Apr-07 6:10 
GeneralRe: Selecting numeric data from varchar string Pin
LobsterHead27-Apr-07 7:35
LobsterHead27-Apr-07 7:35 
QuestionSimple SQL Statment Not working, whats wrong Pin
Ibuprofen26-Apr-07 14:43
Ibuprofen26-Apr-07 14:43 
AnswerRe: Simple SQL Statment Not working, whats wrong Pin
Ibuprofen26-Apr-07 15:22
Ibuprofen26-Apr-07 15:22 
AnswerRe: Simple SQL Statment Not working, whats wrong Pin
N a v a n e e t h26-Apr-07 21:36
N a v a n e e t h26-Apr-07 21:36 
GeneralRe: Simple SQL Statment Not working, whats wrong Pin
Ibuprofen27-Apr-07 6:01
Ibuprofen27-Apr-07 6:01 
QuestionODBC and LDAP Pin
SSMERK00726-Apr-07 7:59
SSMERK00726-Apr-07 7:59 
Question= Incrementing a max value Pin
Dayekh26-Apr-07 3:50
Dayekh26-Apr-07 3:50 
AnswerRe: = Incrementing a max value Pin
perle126-Apr-07 4:12
perle126-Apr-07 4:12 
GeneralRe: = Incrementing a max value Pin
Dayekh26-Apr-07 4:16
Dayekh26-Apr-07 4:16 
GeneralRe: = Incrementing a max value Pin
Pete O'Hanlon26-Apr-07 4:33
mvePete O'Hanlon26-Apr-07 4:33 
QuestionHelp determining start and end times associated with today's date Pin
Marcus J. Smith26-Apr-07 3:46
professionalMarcus J. Smith26-Apr-07 3:46 
AnswerRe: Help determining start and end times associated with today's date Pin
perle126-Apr-07 4:19
perle126-Apr-07 4:19 
GeneralRe: Help determining start and end times associated with today's date Pin
Pete O'Hanlon26-Apr-07 4:26
mvePete O'Hanlon26-Apr-07 4:26 
GeneralRe: Help determining start and end times associated with today's date Pin
Marcus J. Smith26-Apr-07 4:29
professionalMarcus J. Smith26-Apr-07 4:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.