Click here to Skip to main content
15,896,453 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL database table Pin
Yulianto.3-Jul-05 23:46
Yulianto.3-Jul-05 23:46 
GeneralMS SQL database table Pin
phokojoe4-Jul-05 20:32
phokojoe4-Jul-05 20:32 
GeneralRe: MS SQL database table Pin
Yulianto.4-Jul-05 20:43
Yulianto.4-Jul-05 20:43 
GeneralRe: MS SQL database table Pin
phokojoe10-Jul-05 22:00
phokojoe10-Jul-05 22:00 
GeneralRe: SQL database table Pin
phokojoe24-Jul-05 2:53
phokojoe24-Jul-05 2:53 
GeneralRe: SQL database table Pin
Yulianto.24-Jul-05 15:28
Yulianto.24-Jul-05 15:28 
GeneralRe: SQL database table Pin
phokojoe24-Jul-05 21:24
phokojoe24-Jul-05 21:24 
GeneralRe: SQL database table Pin
Yulianto.24-Jul-05 22:20
Yulianto.24-Jul-05 22:20 
You're stil making trouble for your self.

Anyway, use PATINDEX, to get the string between comma.

If your string 'a,b,c' then, the first PATINDEX will get 'a', the second will get 'b', and so on. Then you can update/copy the field using the value you got.

Here's the basic code:

declare @name varchar(15)
set @name='agf,b,c'
select substring(@name,1,patindex('%,%',@name)-1)



<italic>Work hard, Work effectively.
GeneralRe: SQL database table Pin
phokojoe24-Jul-05 22:39
phokojoe24-Jul-05 22:39 
GeneralRunning Total Pin
samoore1-Jul-05 4:50
samoore1-Jul-05 4:50 
Generalwildcards Pin
monageasmear1-Jul-05 4:04
monageasmear1-Jul-05 4:04 
GeneralRe: wildcards Pin
Hesham Amin2-Jul-05 23:31
Hesham Amin2-Jul-05 23:31 
GeneralSubreports using SQL Reporting service Pin
pshinde@brickred.com1-Jul-05 1:07
pshinde@brickred.com1-Jul-05 1:07 
Generalsearching for documents of stored procedures Pin
under281130-Jun-05 23:13
under281130-Jun-05 23:13 
GeneralRe: searching for documents of stored procedures Pin
Colin Angus Mackay30-Jun-05 23:31
Colin Angus Mackay30-Jun-05 23:31 
GeneralOleDbTransaction Rollback Pin
myNameIsRon30-Jun-05 20:45
myNameIsRon30-Jun-05 20:45 
GeneralSQL - write file Pin
Anzy30-Jun-05 17:12
Anzy30-Jun-05 17:12 
GeneralLogin Pin
Desi Bravo30-Jun-05 16:41
Desi Bravo30-Jun-05 16:41 
GeneralRe: Login Pin
Christian Graus30-Jun-05 17:19
protectorChristian Graus30-Jun-05 17:19 
GeneralRe: Login Pin
Yulianto.30-Jun-05 17:45
Yulianto.30-Jun-05 17:45 
GeneralRe: Login Pin
Christian Graus30-Jun-05 17:49
protectorChristian Graus30-Jun-05 17:49 
GeneralRe: Login Pin
Yulianto.30-Jun-05 17:54
Yulianto.30-Jun-05 17:54 
GeneralRe: Login Pin
Christian Graus30-Jun-05 17:56
protectorChristian Graus30-Jun-05 17:56 
GeneralRe: Login Pin
Yulianto.30-Jun-05 18:01
Yulianto.30-Jun-05 18:01 
GeneralRe: Login Pin
Desi Bravo1-Jul-05 5:29
Desi Bravo1-Jul-05 5: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.