jglisson / elmah

Automatically exported from code.google.com/p/elmah
Apache License 2.0
0 stars 0 forks source link

Elmah.SqlServer.sql should detect if the table already exists and return #256

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This is a minor gripe which is why I put it in as an enhancement but it may be 
cleaner to detect if the ELMAH logging table already exists and exit gracefully 
if it does. Something like the following test as a statement before the CREATE 
TABLE statement.

IF EXISTS (SELECT * FROM sys.tables t JOIN sys.schemas s ON t.schema_id = 
s.schema_id WHERE t.name = 'ELMAH_Error' AND s.name = 'dbo')
BEGIN
  set noexec off

  PRINT 'The [dbo].[ELMAH_Error] table already exists. exiting script'

  set noexec on
END

Original issue reported on code.google.com by porter.n...@gmail.com on 13 Oct 2011 at 1:14

GoogleCodeExporter commented 8 years ago
This issue has been migrated to:
https://github.com/elmah/Elmah/issues/256
The conversation continues there.
DO NOT post any further comments to the issue tracker on Google Code as it is 
shutting down.
You can also just subscribe to the issue on GitHub to receive notifications of 
any further development.

Original comment by azizatif on 25 Aug 2015 at 8:21