USE [db] GO /****** Object: Table [dbo].[DebugStore] Script Date: 06/09/2009 15:27:50 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[DebugStore]( [DebugStoreId] [int] IDENTITY(1,1) NOT NULL, [TimeStamp] [timestamp] NOT NULL, [NiceTime] [varchar](200) COLLATE Finnish_Swedish_CI_AS NULL, [Domain_User] [varchar](200) COLLATE Finnish_Swedish_CI_AS NULL, [Msg] [varchar](4000) COLLATE Finnish_Swedish_CI_AS NULL, [DebugLevel] [int] NULL, [DebugMsg] [varchar](4000) COLLATE Finnish_Swedish_CI_AS NULL, [PageName] [varchar](200) COLLATE Finnish_Swedish_CI_AS NULL, [ClassName] [varchar](200) COLLATE Finnish_Swedish_CI_AS NULL, [MethodName] [varchar](200) COLLATE Finnish_Swedish_CI_AS NULL, [MethodNameGui] [varchar](4000) COLLATE Finnish_Swedish_CI_AS NULL, [Ret] [int] NULL, [LineNumber] [int] NULL, [LineNumberGui] [int] NULL, [ProcedureName] [varchar](200) COLLATE Finnish_Swedish_CI_AS NULL, [ProcedureStep] [varchar](4000) COLLATE Finnish_Swedish_CI_AS NULL, [RecordType] [varchar](50) COLLATE Finnish_Swedish_CI_AS NULL, [LogLevel] [int] NULL, CONSTRAINT [PK_DebugStore] PRIMARY KEY CLUSTERED ( [DebugStoreId] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO
USE [db] GO /****** Object: StoredProcedure [dbo].[procUtils_DebugDb] Script Date: 06/09/2009 15:29:08 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[procUtils_DebugDb] ( @DomainUser varchar(200) = null , @debugmsg varchar(2000) , @ret int , @procedureName varchar(200) , @procedureStep varchar(200) ) AS begin set @ret = 1 declare @logLevel int set @logLevel = ( select LogLevel from UserSetting us join [User] u on us.UserId = u.UserId ) INSERT INTO [ocms_dev].[dbo].[DebugStore] ( [Domain_User] ,[DebugMsg] ,[Ret] ,[ProcedureName] ,[ProcedureStep] ,[Loglevel] ) VALUES ( @domainUser ,@debugMsg ,@ret ,@ProcedureName ,@ProcedureStep ,@logLevel ) if ( @@error=0 ) begin set @ret = 0 set @DebugMsg = 'ok' return @ret end else begin set @ret = 1 set @DebugMsg = 'nok' return @ret end end /* USAGE EXEC @return_value = [dbo].[procUtils_DebugDb] @DomainUser = N'domainUser', @debugmsg = N'debugmsg', @ret = 1, @procedureName = N'procName', @procedureStep = N'procStep' */ GO
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!