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.
Author |
Topic |
moramoga
Starting Member
34 Posts |
Posted - 2006-12-05 : 15:28:31
|
hi, I need to male and store procedure, it purpose is to receive Strings with users info and add them to the User database table, I think I most use a cursor, here are the parameters id someone can help me....@name, @estate, @id ,@dateOfRegistration, @email |
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2006-12-05 : 15:38:28
|
You need to post your table structure with your questions so that we can help you more accurately but this is what you asked for. You'll need to change the data types of the parameters to match your table columns.CREATE PROC AddUser(@name varchar(30), @estate varchar(30), @id int,@dateOfRegistration datetime, @email varchar(100))ASINSERT Users (name, estate, id, dateOfRegistration, email)VALUES (@name, @estate, @id, @dateOfRegistration, @email) |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-12-05 : 15:40:27
|
insert into user (name, estate, id, dateofregistration, email)values(@name, @estate, @id, @dateofregistration, @email)Peter LarssonHelsingborg, Sweden |
 |
|
moramoga
Starting Member
34 Posts |
Posted - 2006-12-05 : 15:42:55
|
thanks for the answers,but should that work if I have to add many users at the same time? |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-12-05 : 15:46:05
|
You add one user at a time, calling the SP many times.Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|
|
|