Hi All,
I wanted to use Regex Pattern in my where clause to narrow down the records , but the query is throwing error when running.
I have a table named Detail
CREATE TABLE [dbo].[Audit](
[AuditId] [numeric](18, 0) IDENTITY(1,1) NOT NULL,
[SystemId] [int] NULL,
[Module] [varchar](255) NULL,
[LoginId] [varchar](20) NOT NULL,
[AccountNumber] [char](10) NULL,
[Detail] [text] NULL,
[ActionDate] [datetime2](3) NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[Audit] ADD CONSTRAINT [DF_Audit_ActionDate] DEFAULT (getdate()) FOR [ActionDate]
GO
when i try to run the below query
SELECT * FROM Audit WHERE Detail REGEXP '^b';
Im getting below error :
An expression of non-boolean type specified in a context where a condition is expected, near 'REGEXP'.
Please throw some light on it.