From: Mecn on
There is really no error handling for SQL2000

"Erland Sommarskog" <esquel(a)sommarskog.se> wrote in message
news:Xns9D93A3C18B6D7Yazorman(a)127.0.0.1...
> Mecn (mecn(a)yahoo.com) writes:
>> I am exec a SP with a file location parameter.
>> If I entered a not exist file location, raiserror() should give me
>> "path/file do not exist" something like that.
>
> And what does the procedure do? BULK INSERT?
>
> I think you should let it suffice with the error message from BULK
> INSERT.
>
> One problem is that there is no good way to check from T-SQL whether a
> file exists or not.
>
> Another problem is that you cannot catch the error message from BULK
> INSERT in SQL 2000 - just as you cannot catch any error message from
> SQL 2000. The message from BULK INSERT is particularly difficult, because
> it is considered a compilation error. This means that the procedure is
> aborted in this case, so even in SQL 2005 this is tricky.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx


From: Erland Sommarskog on
Mecn (mecn(a)yahoo.com) writes:
> There is really no error handling for SQL2000

At least any not any generic and useful, no. This is an area where
SQL 2005 meant a huge improvement. And I mean *huge*.

--
Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx