Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 15th, 2004, 12:08 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Hyderabad, , India.
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default To split values and store in the database

I am inserting the multiple values in the database for a particular user, but now i want to insert the splitted values with that username.
eg,
user name areas
abc 10,14,15

Now i want to store in other table as
user name areas
abc 10
abc 14
abc 15


Please reply as soon as possible.
Reply With Quote
  #2 (permalink)  
Old July 15th, 2004, 06:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi there,

If you don't use any client applications that could do this in much easier ways for you, then you will have to write a procedure/function that could do this for you in your Database.

I am not sure if you are trying to do this from a client-side application or on the SQL server directly. Let me know on this.

Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
  #3 (permalink)  
Old July 15th, 2004, 06:48 AM
Friend of Wrox
Points: 1,288, Level: 14
Points: 1,288, Level: 14 Points: 1,288, Level: 14 Points: 1,288, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2004
Location: Stockholm, Sweden
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

If you are using a web technology then you can change it by using any client side scripting

Numan
--------------------------------------------------
Love is the most precious thing of this world. So find and grab it!
Reply With Quote
  #4 (permalink)  
Old July 15th, 2004, 09:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oklahoma City, Oklahoma, USA.
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I do something similiar to this all the time.

<%
Dim strAreas
Dim aryNumbers
Dim strUser

strUser = "abc"
strAreas="10,14,15"
aryNumbers = Split(strAreas, ",")

for i = 0 to UBound(aryNumbers)

    strSQL = "INSERT INTO YourDataBase (Username, Areas) " &_
            "VALUES ('" & strUser & "', '" & aryNumbers(i) & "');"
    objConn.Execute(strSQL)

    Response.Write(strUser & " - " & aryNumbers(i) & "----Was Inserted<BR>")
next
%>
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to store "SET" values to Vector ? msg2ajay JSP Basics 1 September 4th, 2007 06:45 AM
use regex to split string store in dictionary edman747 VB How-To 0 January 29th, 2007 12:02 AM
Store Checkbox values in MySQL Database jkilgore Beginning PHP 1 July 7th, 2005 03:43 PM
Split database rylemer Access 1 August 30th, 2004 05:33 PM
store multiple values in a string bamboat_3 General .NET 3 May 23rd, 2004 07:32 AM



All times are GMT -4. The time now is 08:42 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.