Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
help... i need to extract this string with the following arguments...1. @command 2. @FamilyNane3. @FirstName4. @CellNo5. @PIN"REG ORAN/RODERICK 09197264062 1234"result shoul be this....1. @command = REG2. @FamilyNane = ORAN3. @FirstName = RODERICK4. @CellNo = 09197264062 5. @PIN = 1234pls ASAP!I think we can use xp_sscanf
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts
Posted - 2004-12-11 : 02:15:43
I don't know what the rules are but it looks like you could use patindex and substring to pull out the portions of the string that you want. See BOL (Books Online) for details on vboth of these.HTH=================================================================Happy Holidays!
jonasalbert20
Constraint Violating Yak Guru
300 Posts
Posted - 2004-12-11 : 02:27:05
The syntax for the string...."REG ORAN/RODERICK 09197264062 1234"is @command + [space] + @FamilyNane + "/" + @FirstName + [space] + @CellNo + [space] + @PINnow i have to extract it.....Want Philippines to become 1st World COuntry? Go for World War 3...
however results is this...1. @command = REG2. @FamilyNane = ORAN/RODERICK3. @FirstName = 091972640624. @CellNo = 12345. @PIN = NULLWant Philippines to become 1st World COuntry? Go for World War 3...
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts
Posted - 2004-12-11 : 02:56:42
Or you can ignore my advice and just do it your way... Either way, I'm happy.HTH=================================================================Happy Holidays!
jonasalbert20
Constraint Violating Yak Guru
300 Posts
Posted - 2004-12-11 : 03:12:10
pLEASE anybody can help me?Want Philippines to become 1st World COuntry? Go for World War 3...