stymied by reg exp

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
mike_d
Posts: 17
Joined: Mon Dec 01, 2003 9:44 pm
Location: Sonora, CA

stymied by reg exp

Post by mike_d »

my forehead is bloody... appreciate any help

looking to do a reg expression find for the following:

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

these sql settings may be either on or off, but its always the same 4 lines together as a group. I'm trying to find all 4 lines using a reg exp but have not spent alot of time using reg expressions and I'm going looney.

any help appreciated

mike
User avatar
s_reynisson
Posts: 940
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

first try, using POSIX:

^SET QUOTED_IDENTIFIER (ON|OFF).*\n^GO.*\n^SET ANSI_NULLS (ON|OFF).*\n^GO.*\n

note it's all on one line. HTH
Then I open up and see
the person fumbling here is me
a different way to be
mike_d
Posts: 17
Joined: Mon Dec 01, 2003 9:44 pm
Location: Sonora, CA

Post by mike_d »

works, thanks

was trying to do something like

SET [QUOTED_IDENTIFIER|ANSI_NULLS].[a-zA-Z][:space:]


and then add on a \nGO

but that didn't fly

thanks for the help
User avatar
talleyrand
Posts: 625
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

In MS Query Analyzer, Tools -> Options, Scripts Tab. Check ``Do not use a command terminator'' to remove the Gos from your scripts. I couldn't see any options for removing the other lines though.
I choose to fight with a sack of angry cats.
mike_d
Posts: 17
Joined: Mon Dec 01, 2003 9:44 pm
Location: Sonora, CA

Post by mike_d »

using enterprise mangler to get script file for all stored procedures, doesn;t do a very good job.

trying to compare whats in sql vs whats in my source code via examdiff, but the process is less than smooth...
User avatar
talleyrand
Posts: 625
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

Ah, then allow me to sing the praises of Red Gate's Sql Compare. Does just fine in showing the changes between the objects in SQL Server.
I choose to fight with a sack of angry cats.
Post Reply