Re: try catch ok, what about finally?
- From: "Mike C#" <xyz@xxxxxxx>
- Date: Wed, 8 Nov 2006 20:35:28 -0500
"JCollum" <jcollum@xxxxxxxxx> wrote in message
news:1162937887.852302.7560@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
It appears to work from here. Is this test similar to what you are trying
to do?
CREATE TABLE #test (i INT NOT NULL PRIMARY KEY);
CREATE TABLE #log (err NVARCHAR(2000) NOT NULL);
INSERT INTO #test (i)
VALUES (1);
BEGIN TRY
INSERT INTO #test (i)
VALUES (1);
END TRY
BEGIN CATCH
INSERT INTO #log (err)
VALUES (ERROR_MESSAGE());
END CATCH
SELECT * FROM #log;
DROP TABLE #test;
DROP TABLE #log;
.
- Follow-Ups:
- Re: try catch ok, what about finally?
- From: JCollum
- Re: try catch ok, what about finally?
- References:
- try catch ok, what about finally?
- From: JCollum
- try catch ok, what about finally?
- Prev by Date: Re: try catch ok, what about finally?
- Next by Date: Re: try catch ok, what about finally?
- Previous by thread: Re: try catch ok, what about finally?
- Next by thread: Re: try catch ok, what about finally?
- Index(es):