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.
| Author |
Topic |
|
vragini
Starting Member
2 Posts |
Posted - 2006-06-19 : 15:27:34
|
| I have to write a script that would make prefixes for a wordfor ex: Ragini Venkataraman ( is the string) is the record from one table and i need to store prefix "rag" and "ven" as two records in another table....I need to know if this can be done using just SQL stored procedures or triggers...or if there needs to be some code(java code..we are using language java) written..any help on how it can be done would be great....iam completely new to sql and it all seems confusing....thanks |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-06-19 : 15:47:30
|
| You could split the string (using Space as a delimiter), and take up-to the first three characters of each word into another table.Is that the sort of thing you are thinking of? If so SQL would be pretty efficient for that.If you do it in Java you will have to pass each prefix to SQL, so that's N-transactions from Client to Server (there are smarter ways, but that's the basics of it). So doing this type of thing in SQL usually makes sense.Kristen |
 |
|
|
vragini
Starting Member
2 Posts |
Posted - 2006-06-19 : 17:13:12
|
| thanks kristen |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-20 : 02:13:51
|
| Why do you want to store partial names in other table in two rows?MadhivananFailing to plan is Planning to fail |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-06-20 : 16:51:23
|
| Quickie-lookup? If so seemed like a valid approach to me - although overall Soundex might be better - or even CHECKSUMKristen |
 |
|
|
|
|
|