Last post Mar 21, 2010 06:23 PM by DigiMortal
Mar 21, 2010 12:54 PM|Jay123____|LINK
Whats the code for error handling.
Basicly i have a set of code that creates a table in sql databse.
There cannot be duplicate tables and i want to tell it what to do when the duplicate table error is thrown (# 2714).
is there somethng like
If error 2714 then
Mar 21, 2010 03:08 PMfirstname.lastname@example.org|LINK
You call easily create a stored procedure to check table existance before creating a new table, based on the result of it you may creating a new table or return error back to your user!
follow the same issue:
wish it helps
Mar 21, 2010 05:55 PM|Jay123____|LINK
Yeah but it seems a bit too much.
i was hoping to catch it with VisualBasic before it even posts.
if exists(Sql table) then
Dont DO THIS
Cant find the exact code though. im gonna keep looking and illl check back here soon. thanks for looking.
Mar 21, 2010 06:23 PM|DigiMortal|LINK
If you are using SQL to create your table then you can check if table already exists.
IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='<table_name>')
<CREATE TABLE HERE>