June 16, 2006 at 2:10 am
how to make comman stored procedure for add in any table in Sql2000
thax in advance
June 16, 2006 at 2:28 am
What is your exact requirment?
------------
Prakash Sawant
http://psawant.blogspot.com
June 16, 2006 at 3:47 am
i want to make genral storedprocedure for add data in any table.
i want pass only tablename and field values as parameter s.
for this i want stored procrdure.
Thanx in advance
June 16, 2006 at 3:59 am
Then you need to pass 3 parameter's, table name, column list & values.
It will be easy for you to do a direst insert instead of doing it through the sp
As even sp will also do the simple insert, but passing the parameter's can be a problem as you may have to take care of coma separators in column list & values as well.
------------
Prakash Sawant
http://psawant.blogspot.com
June 16, 2006 at 6:17 am
You might be able to make one stored procedure per table, but it's not going to work as a generic 'for all tables' script. All your tables don't have the same column names nor the same number of columns. Plus they probably don't have the same datatypes.
You create a procedure by declaring variables. You have to declare the exact amount that your procedure needs. And each variable has to have a datatype assigned. Those then would have to match the table column they are being used for.
-SQLBill
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply