June 28, 2008 at 4:02 am
how can i insert multiple rows and multiple columns in sql server 2005 database using vb.net the row contains an application number as primary key all corresponding columns are related to application number so if we want insert 200 applications as in the order with name,address, etc fields how can we insert... with end with is hopeful or not ?:)
June 28, 2008 at 10:50 am
Although this sounds like a home work question. Start here:
1. Open your .net interface
2. Click on Help
3. Enter ADO in help search window
4. Read the subject "Introduction to Data Access with ADO.NET" which will lead you by the hand through the entrie subject
June 28, 2008 at 2:30 pm
It's not clear what you want. Please explain what you want to do, and break your sentences so we can understand the process you want to consider.
If you want to insert multiple rows, you can either send multiple INSERT statements, or you'd have to send some XML type stream to the server and then have a stored procedure on the server to break apart the XML.
If you can get disk access from the server, you can BCP or use something like SSIS to insert things. SSIS can be driven programatically as well.
June 28, 2008 at 11:51 pm
Details ...
application details stored in tbl_application as follows
code, no, name, amount
sa1 1 jij 1000
sa1 2 bini 2000
sa2 3 hij 3000
i want to insert those rows (about 200 rows with different number and name but with same code .and i want to insert these rows in a order of number to different table named tbl_trans
June 29, 2008 at 9:04 am
If I understand you correctly the following T-SQL should do what you want:
Insert INTO tbl_trans(code,no,name,amount)
SELECT code, no, name, amount FROM tbl_application ORDER BY no
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply