ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 31st, 2011, 08:49 AM
brest2810 brest2810 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Posts: 1 brest2810 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 4 sec
Reputation Power: 0
INSERT multiple records at the same time

Hi,

I want to insert several records at the same time from a form (asp/Ms SQL)

I have in this form a list of football players and checkboxes in order to choose if they have played or not.


So when form is submitted it have to store in a table, idplayers and idmatch value (hidden form value).
That could be used to list players by match

How can i do it?

I ve made an asp page listing the players with player's id ans check box for each player to choose or not.



Please help?

Thanks a lot

Reply With Quote
  #2  
Old August 31st, 2011, 03:07 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Jun 2003
Posts: 14,257 Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 19 h 1 m 26 sec
Reputation Power: 4445
Start by visiting the documentation for the INSERT command for your db, which will show you how you need to write the SQL for the insert.
__________________
======
Doug G
======
It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi

Reply With Quote
  #3  
Old August 31st, 2011, 06:06 PM
dotnetmind dotnetmind is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Posts: 46 dotnetmind User rank is Corporal (100 - 500 Reputation Level)dotnetmind User rank is Corporal (100 - 500 Reputation Level)dotnetmind User rank is Corporal (100 - 500 Reputation Level)dotnetmind User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 8 h 7 m 29 sec
Reputation Power: 3
Insert multiple rows in single query using TSQL

To insert multiple rows with the help of single query you can use following syntax:

Code:
Insert
  Into daTable
     ( col1, col2, ... coln )
values
     ( '21',   9,  ... 'oh' )
    ,( '22',  37,  ... 'my' )
    ,( '23',  42,  ... 'we' )
    ,( '24',  11,  ... 'be' )
    ,( '25',  77,  ... 'at' );


Code:
INSERT INTO Table1 (FirstColumn, SecondColumn)
SELECT 'First' ,1
UNION ALL
SELECT 'Second' ,2
UNION ALL
SELECT 'Third' ,3
UNION ALL
SELECT 'Fourth' ,4
UNION ALL
SELECT 'Fifth' ,5

Reply With Quote
  #4  
Old September 17th, 2011, 12:44 AM
leonardo74 leonardo74 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2011
Posts: 1 leonardo74 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 44 sec
Reputation Power: 0
Hai, you can use sqlbulkcopy class in asp.net to insert multiple values.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > INSERT multiple records at the same time

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap