Re: Way too many Stored Procedure Parameters

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Sam,

Assuming you don't want to write a code-gen product, I would do the
following (this assumes you are using SQL Server).

Start by creating a typed data set, which will create the
insert/update/delete/select statements for the table.

Create a test program to insert one record into the table with the typed
data set.

Run SQL Server profiler on the database in SQL Server (filter by your
machine as the client) and make sure you get the batch statement begin, and
the statement begin events. You also want the statement text in the trace.

Run your program. You will see something like "sp_execute" along with a
parameterized statement (your insert, update, or delete statement) along
with a list of parameters and types.

From this statement, you should be able to generate your stored
procedure easily on the database. It will require a bunch of copy and
pasting, but it's better than having to do the field and type discovery by
hand.

Once you have your stored procedure, you can just drag it into VS.NET
and it will create a wrapper for you to call it by, or you can use the Data
Access Application Block to make the call for you, where it generates all
the SqlParameter instances for you, and sets them up correctly.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

"Sam Shrefler" <sshrefler@xxxxxxxxx> wrote in message
news:1177601206.565156.322870@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a database table that contains approx 150 columns per row. I
need to update all 150 columns at once. To create a stored procedure
will cause me to have to create 150 sqlParameters....Rows will only be
updated one at a time. Does anyone else have any thoughts on the best
way to handle this. The data is available to .NET in the form of a
typed transfer object with 150 data elements in it.

Thanks



.



Relevant Pages

  • Re: Problem using SP as record source with Access2002 & SQL Server 7
    ... I've installed a brand new copy of SQL Server 2000 with the original ... I've created the folowing stored procedure for the resync ... Resync Command: ALL_CUSTOMERS_RESYNC? ... I need to upgrade to a newer version of Microsoft SQL ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Creating a database
    ... Please do yourself a favor, find a local user group, or buy a beginning book on SQL Server or take a class, you will save yourself a great deal of pain in the long run. ... CREATE DATABASE Products ... I can create a stored procedure from within the Server Explorer and from ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: SQL/ADO (2.8) Timeout Error - Cant resolve
    ... > Server 2000 back end. ... > timeout limit. ... And I’ve used SQL Query Analyzer to run the ... I am running a stored procedure that will backup a SQL Server ...
    (microsoft.public.sqlserver.clients)
  • Re: Breakpoints in T-SQL not hit from VS 2005 with SQL 2005
    ... Open stored procedure in server explorer and set breakpoint ... Run the procedure from SQL Server Management Studio ... SQL Server 2005 Developer Edition installed on local PC. ... I created a windows project and called stored procedure using ...
    (microsoft.public.vsnet.debugging)
  • RE: Stored procedure / .NET woes
    ... Check the available network protocols on both the server and the client (web ... using the SQL client and server network tools. ... > Strangely enough running the same stored procedure through the SQL ...
    (microsoft.public.dotnet.framework.adonet)