Click here to Skip to main content
15,888,351 members
Home / Discussions / Database
   

Database

 
GeneralRe: some newbie questions:[sqlservr 2005 , C# 05] Pin
Colin Angus Mackay16-Feb-07 6:47
Colin Angus Mackay16-Feb-07 6:47 
GeneralRe: some newbie questions:[sqlservr 2005 , C# 05] Pin
giddy_guitarist18-Feb-07 0:31
giddy_guitarist18-Feb-07 0:31 
GeneralRe: some newbie questions:[sqlservr 2005 , C# 05] Pin
Colin Angus Mackay18-Feb-07 1:12
Colin Angus Mackay18-Feb-07 1:12 
GeneralRe: some newbie questions:[sqlservr 2005 , C# 05] Pin
giddy_guitarist18-Feb-07 2:37
giddy_guitarist18-Feb-07 2:37 
Questionsql triggers Pin
kalyan_241613-Feb-07 17:21
kalyan_241613-Feb-07 17:21 
QuestionJob Name Pin
Member 382635313-Feb-07 11:59
Member 382635313-Feb-07 11:59 
AnswerRe: Job Name Pin
Ennis Ray Lynch, Jr.13-Feb-07 12:13
Ennis Ray Lynch, Jr.13-Feb-07 12:13 
AnswerRe: Job Name Pin
Harini N K21-Feb-07 22:35
Harini N K21-Feb-07 22:35 
Hi Deb,

Just tried out for your question. Use the foll. example. This example will returns remaining string after '-'. Do one thing, insert these values (rows) in a temporary table and use the same query again using the temporay table.

Uses : Substring(), CharIndex() and PatIndex():-

For example:
Use PUBS
GO
INSERT INTO @Table1 (col1, col2)
VALUES

SELECT
substring(Emp_Id,charindex('-',emp_id)+1,len(emp_id)-charindex('-',emp_id)) as EmplName,
emp_id
FROM Employee

SELECT * FROM @Table1
/*use the same expression as given below if there are more than 1 dashes in the column. So that you can pull out exact numbers from the second query */

where charindex('-',emp_id) != 0

If that works, then please let me know Smile | :)

- Harini
QuestionOrder of operations and Short circuit Pin
Keith Andersch13-Feb-07 9:51
Keith Andersch13-Feb-07 9:51 
AnswerRe: Order of operations and Short circuit Pin
Pete O'Hanlon13-Feb-07 10:13
mvePete O'Hanlon13-Feb-07 10:13 
GeneralRe: Order of operations and Short circuit Pin
Keith Andersch13-Feb-07 10:33
Keith Andersch13-Feb-07 10:33 
GeneralRe: Order of operations and Short circuit Pin
M A A Mehedi Hasan13-Feb-07 23:25
M A A Mehedi Hasan13-Feb-07 23:25 
GeneralRe: Order of operations and Short circuit Pin
Pete O'Hanlon13-Feb-07 23:45
mvePete O'Hanlon13-Feb-07 23:45 
QuestionProgram can't connect with the server ,, vb.net 2005 Pin
kindman_nb13-Feb-07 8:49
kindman_nb13-Feb-07 8:49 
AnswerRe: Program can't connect with the server ,, vb.net 2005 Pin
Pete O'Hanlon13-Feb-07 9:24
mvePete O'Hanlon13-Feb-07 9:24 
GeneralRe: Program can't connect with the server ,, vb.net 2005 Pin
kindman_nb13-Feb-07 9:30
kindman_nb13-Feb-07 9:30 
GeneralRe: Program can't connect with the server ,, vb.net 2005 Pin
Pete O'Hanlon13-Feb-07 9:40
mvePete O'Hanlon13-Feb-07 9:40 
GeneralRe: Program can't connect with the server ,, vb.net 2005 Pin
kindman_nb13-Feb-07 9:54
kindman_nb13-Feb-07 9:54 
GeneralRe: Program can't connect with the server ,, vb.net 2005 Pin
Pete O'Hanlon13-Feb-07 10:02
mvePete O'Hanlon13-Feb-07 10:02 
GeneralRe: Program can't connect with the server ,, vb.net 2005 Pin
kindman_nb13-Feb-07 20:56
kindman_nb13-Feb-07 20:56 
QuestionOleDbCommand Pin
TheJudeDude13-Feb-07 7:25
TheJudeDude13-Feb-07 7:25 
AnswerRe: OleDbCommand Pin
andyharman13-Feb-07 7:53
professionalandyharman13-Feb-07 7:53 
GeneralRe: OleDbCommand Pin
TheJudeDude13-Feb-07 9:27
TheJudeDude13-Feb-07 9:27 
GeneralRe: OleDbCommand Pin
TheJudeDude13-Feb-07 10:00
TheJudeDude13-Feb-07 10:00 
AnswerRe: OleDbCommand Pin
TheJudeDude13-Feb-07 11:13
TheJudeDude13-Feb-07 11:13 

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.