|
Posted by Erland Sommarskog on 10/05/57 11:27
laurenq uantrell (laurenquantrell@hotmail.com) writes:
> I'm wondering if I'm doing this right. Wondering about the transactions
> and error handling. (Do I even need to put BEGIN TRANSACTION AND
> COMMIT TRANSACTION in there?)
Depends on your business requirements. If it's OK that a row gets
inserter into tblStuff, but not any row in tblMoreStuff, you can take
it out entirely. If you want both rows or none of the rows inserted,
you should take out the COMMIT and the BEGIN in the middle, to make
it one single transaction.
> I think that this sproc is causing occasional blocking:
Since it's only two plain insert statements, that's a bit surprising.
But if there is a long-running trigger on one of the tables you could
get blocking.
> @Col3Data ntext = Null,
>...
> 'Text Label: ' +
> isnull(Cast(@Col3Data AS nvarchar(4000)),'<none>')
>...
What's the point with accepting an ntext parameter, if you truncate it
anyway?
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Navigation:
[Reply to this message]
|