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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Inserting multiple records

Author  Topic 

adrianle
Starting Member

3 Posts

Posted - 2011-03-17 : 17:33:24
I have a table on an asp page where a unique ID is hidden, and there are multiple rows in the table with set empty form fields. I need to know how to code the asp page so that on submit, the page will insert multiple rows, in particular only those rows where the user has entered data. Help?.. Does the bulk insert do this??

ajthepoolman
Constraint Violating Yak Guru

384 Posts

Posted - 2011-03-18 : 10:48:30
Wow, there are quite a few ways this could be done. I would need to see the code on the asp page before I could comment further.

Hey, it compiles.
Go to Top of Page

adrianle
Starting Member

3 Posts

Posted - 2011-03-18 : 11:55:07
AT this point the only actual ASP on the page assigns a UID to a hidden form field, that's it. I'd need to know the best method to then perform the bulk insert...
Go to Top of Page

ajthepoolman
Constraint Violating Yak Guru

384 Posts

Posted - 2011-03-18 : 12:07:41
Well regarding the "where the user has entered data" part, you just need a simple check to see if there is in fact any data in the field. An easy way with text fields is to check the length of the text property. If (FirstField.Text.Length > 0) would be a basic check to see if there is data in a field. Again, depending on how you set up the page, you might have to do this on every single field. Or perhaps you only check certain fields and assume that if it has a value in it then the rest of the corresponding fields will have info.

Hey, it compiles.
Go to Top of Page
   

- Advertisement -