Solved

SQL Server Stored Procedures and Transaction Questions

Posted on 2007-11-21
3
564 Views
Last Modified: 2008-02-02
Hello Experts!
Stored Procedures:
Is it possible to pass an array of parameters object directly to a stored procedure? I mean I don;t want to pass each parameter individualy, but pass a single array containing all pre-configured paramentes to the stored procedure.
I would like to see an example using C#.

Transactions:
The SqlTransaction object has the IsolationLevel property. I understand perfectly the ReadUncomminted, ReadComminted, RepeatableRead and Serializable isolation levels, but I have no idea about what the Unspecified level is. When, how and what for is it used?

Thanks!
0
Comment
Question by:andrepires
3 Comments
 
LVL 18

Accepted Solution

by:
Yveau earned 167 total points
ID: 20330658
Stored Procedures:
No, there is not an array type in SQL Server. Alternatives is passing a parameter of type table or passing a string like: 'parm1=value1, parm2=value2, ...'

Transactions:
... unspecified is probably the 'use whatever the server is using at this moment, don't worry about it, just run the SQL code!' option. Not sure on this one ...

Hope this helps ...
0
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 167 total points
ID: 20332544
>Is it possible to pass an array of parameters object directly to a stored procedure?
Eventhough there is no array datatype, we can pass those values as CSV (Comma separated values). The logic should be implemented inside the sp to handle these.


0
 
LVL 12

Assisted Solution

by:kselvia
kselvia earned 166 total points
ID: 20337177
Here are a couple of examples of using csv values as stores procedure arguments

http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm#top

http://www.sommarskog.se/arrays-in-sql-2005.html
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to share SSIS Package? 6 37
SQL Server Designer 19 41
Increment column based of a FK 8 22
access query to sql server 3 20
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question