Wrox Programmer Forums
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 15th, 2006, 05:04 AM
Registered User
Join Date: Feb 2006
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:(

Old February 15th, 2006, 02:12 PM
Friend of Wrox
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts

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.


Old February 15th, 2006, 03:20 PM
Friend of Wrox
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts

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.

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 07: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

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.