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
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 Display Modes
  #1 (permalink)  
Old February 15th, 2006, 04:04 AM
Registered User
 
Join Date: Feb 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default inserting values

is it possible to insert more than one value for any particular field in the table. like we can insert multiple mail id's separating them by commas. is it possible to do that in sql server:(

Reply With Quote
  #2 (permalink)  
Old February 15th, 2006, 01:12 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,346
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You have to create a separate insert statement for each row. You can pass a stirng of IDs separated by commas and then split them up. However in the end, you are still creating one insert statement per ID.

Jim

Reply With Quote
  #3 (permalink)  
Old February 15th, 2006, 02:20 PM
Friend of Wrox
Points: 2,077, Level: 18
Points: 2,077, Level: 18 Points: 2,077, Level: 18 Points: 2,077, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
Posts: 594
Thanks: 6
Thanked 3 Times in 3 Posts
Default

You can insert data separated by commas without splitting the IDs but I wouldn't suggest that you do that. If you didn't split on the insert, you'd always have to split on the select. Plus, you're just asking for nothing but problems in the long run. Not only that, it violates the First Normal Form of database normalization:

"All attributes must be atomic, that is, only one single value represented in a single attribute in a single instance of an entity."
- SQL Server 2000 Database Design, WROX Press, pg. 148

If it was me, I wouldn't go there.

Reply With Quote
Reply


Thread Tools
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
Inserting values from other tables TheAndruu SQL Language 7 May 27th, 2007 10:47 AM
Sqldatasource Inserting calculated values: nuttylife2 ASP.NET 2.0 Professional 0 June 26th, 2006 05:36 PM
inserting values into a database RPG SEARCH ASP.NET 1.0 and 1.1 Basics 3 February 5th, 2005 06:56 PM
Regarding Inserting values to ntext field Hari_Word ADO.NET 1 August 31st, 2004 05:15 PM
inserting values error - Please help gtmm9 Classic ASP Databases 1 October 6th, 2003 11:43 AM



All times are GMT -4. The time now is 12:21 PM.


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