I want to return a list of every sp that is called by a given sp, and
sp_depends is anything but...
The user will have to supply the name of the first/top level SP and then my
app will do the rest from there.
My question:
Will the following expression always work. I have tested it and it works
now, but I am very consistant in my naming convention in SQL SERVER: I
explicitly use a fully qualified name (3 or 4 part e.g: MyDB.MySchema.M yTable
and MyLinkedSrvr.My DB.MySchema.MyT able) and this will need to be used by
others.
The expression:
(?:(?:exec|exec ute)\s*(?:@\w*\ s*=)?)(?:\s*\[?\w*\]?\.)?(\s*\[?\w*\]?\.)?(\s*\[?\w*\]?)
--
kevin... 4 2164
Hi kevin,
This is what you need:
(?i)(?:execute| exec)\s+(?:(?:([#@_a-z][#@_$10-9a-z]*)(?!\]))|[\[]([#@_a-z][#@_$10-9a-z\s]*)[\]])
If you test your original Regular Expression against the following, you will
see that its flaw lies in its inability to identify the complete Stored
Procedure Name if it has spaces in it:
SET QUOTED_IDENTIFI ER ON
GO
SET ANSI_NULLS ON
GO
execute this
exec [this]
EXEC [Sales by Year] '12/12/2001', '12/31/2004'
exec this a, b, c
execute [_a thing]
GO
SET QUOTED_IDENTIFI ER OFF
GO
SET ANSI_NULLS ON
GO
The one I gave you will do this, and will put the Stored Procedure names
into Group 1 and Group 2 respectively, without the square brackets.
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
Hard work is a medication for which
there is no placebo.
"kevin" <kw************ *********@fortk noxnational.com > wrote in message
news:01******** *************** ***********@mic rosoft.com... I want to return a list of every sp that is called by a given sp, and sp_depends is anything but...
The user will have to supply the name of the first/top level SP and then my app will do the rest from there.
My question: Will the following expression always work. I have tested it and it works now, but I am very consistant in my naming convention in SQL SERVER: I explicitly use a fully qualified name (3 or 4 part e.g: MyDB.MySchema.M yTable and MyLinkedSrvr.My DB.MySchema.MyT able) and this will need to be used by others.
The expression: (?:(?:exec|exec ute)\s*(?:@\w*\ s*=)?)(?:\s*\[?\w*\]?\.)?(\s*\[?\w*\]?\.)?(\s*\[?\w*\]?)
-- kevin...
Correction:
(?i)(?:execute| exec)\s+(?:(?:([#@_a-z][#@_$\.0-9a-z]*)(?!\]))|[\[]([#@_a-z][#@_$\.0-9a-z\s]*)[\]])
I had left the '.' character out of the allowable characters. I was going by
the SQL Server Books Online reference, which didn't include it in the lists
of allowable name characters (probably sinces it isn't exactly part of the
name). Also, I had corrected myself where I had "1-9" and made it "0-9" -
but I had missed deleting the '1'. That didn't negatively affect the
results, but was superfluous.
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
Hard work is a medication for which
there is no placebo.
"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:OR******** ******@TK2MSFTN GP04.phx.gbl... Hi kevin,
This is what you need:
(?i)(?:execute| exec)\s+(?:(?:([#@_a-z][#@_$10-9a-z]*)(?!\]))|[\[]([#@_a-z][#@_$10-9a-z\s]*)[\]])
If you test your original Regular Expression against the following, you will see that its flaw lies in its inability to identify the complete Stored Procedure Name if it has spaces in it:
SET QUOTED_IDENTIFI ER ON GO SET ANSI_NULLS ON GO
execute this
exec [this] EXEC [Sales by Year] '12/12/2001', '12/31/2004'
exec this a, b, c
execute [_a thing]
GO SET QUOTED_IDENTIFI ER OFF GO SET ANSI_NULLS ON GO
The one I gave you will do this, and will put the Stored Procedure names into Group 1 and Group 2 respectively, without the square brackets.
-- HTH,
Kevin Spencer Microsoft MVP Professional Numbskull
Hard work is a medication for which there is no placebo.
"kevin" <kw************ *********@fortk noxnational.com > wrote in message news:01******** *************** ***********@mic rosoft.com...I want to return a list of every sp that is called by a given sp, and sp_depends is anything but...
The user will have to supply the name of the first/top level SP and then my app will do the rest from there.
My question: Will the following expression always work. I have tested it and it works now, but I am very consistant in my naming convention in SQL SERVER: I explicitly use a fully qualified name (3 or 4 part e.g: MyDB.MySchema.M yTable and MyLinkedSrvr.My DB.MySchema.MyT able) and this will need to be used by others.
The expression: (?:(?:exec|exec ute)\s*(?:@\w*\ s*=)?)(?:\s*\[?\w*\]?\.)?(\s*\[?\w*\]?\.)?(\s*\[?\w*\]?)
-- kevin...
Kevin,
Point well taken.
One major flaw in yours though is that is doesn't handle the return type as
in the following.
I'll merge the two and thanks a lot for the input.
*************** *************** ************
--not matched
execute @return = this
exec [this]
EXEC [Sales by Year] '12/12/2001', '12/31/2004'
exec this a, b, c
execute [_a thing]
*************** *************** ************
kevin
--
kevin...
"Kevin Spencer" wrote: Correction:
(?i)(?:execute| exec)\s+(?:(?:([#@_a-z][#@_$\.0-9a-z]*)(?!\]))|[\[]([#@_a-z][#@_$\.0-9a-z\s]*)[\]])
I had left the '.' character out of the allowable characters. I was going by the SQL Server Books Online reference, which didn't include it in the lists of allowable name characters (probably sinces it isn't exactly part of the name). Also, I had corrected myself where I had "1-9" and made it "0-9" - but I had missed deleting the '1'. That didn't negatively affect the results, but was superfluous.
-- HTH,
Kevin Spencer Microsoft MVP Professional Numbskull
Hard work is a medication for which there is no placebo.
"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message news:OR******** ******@TK2MSFTN GP04.phx.gbl... Hi kevin,
This is what you need:
(?i)(?:execute| exec)\s+(?:(?:([#@_a-z][#@_$10-9a-z]*)(?!\]))|[\[]([#@_a-z][#@_$10-9a-z\s]*)[\]])
If you test your original Regular Expression against the following, you will see that its flaw lies in its inability to identify the complete Stored Procedure Name if it has spaces in it:
SET QUOTED_IDENTIFI ER ON GO SET ANSI_NULLS ON GO
execute this
exec [this] EXEC [Sales by Year] '12/12/2001', '12/31/2004'
exec this a, b, c
execute [_a thing]
GO SET QUOTED_IDENTIFI ER OFF GO SET ANSI_NULLS ON GO
The one I gave you will do this, and will put the Stored Procedure names into Group 1 and Group 2 respectively, without the square brackets.
-- HTH,
Kevin Spencer Microsoft MVP Professional Numbskull
Hard work is a medication for which there is no placebo.
"kevin" <kw************ *********@fortk noxnational.com > wrote in message news:01******** *************** ***********@mic rosoft.com...I want to return a list of every sp that is called by a given sp, and sp_depends is anything but...
The user will have to supply the name of the first/top level SP and then my app will do the rest from there.
My question: Will the following expression always work. I have tested it and it works now, but I am very consistant in my naming convention in SQL SERVER: I explicitly use a fully qualified name (3 or 4 part e.g: MyDB.MySchema.M yTable and MyLinkedSrvr.My DB.MySchema.MyT able) and this will need to be used by others.
The expression: (?:(?:exec|exec ute)\s*(?:@\w*\ s*=)?)(?:\s*\[?\w*\]?\.)?(\s*\[?\w*\]?\.)?(\s*\[?\w*\]?)
-- kevin...
> One major flaw in yours though is that is doesn't handle the return type as in the following.
Darn, kevin, you're right. I overlooked that one.
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Numbskull
Hard work is a medication for which
there is no placebo.
"kevin" <kw************ *********@fortk noxnational.com > wrote in message
news:C1******** *************** ***********@mic rosoft.com... Kevin,
Point well taken.
One major flaw in yours though is that is doesn't handle the return type as in the following.
I'll merge the two and thanks a lot for the input.
*************** *************** ************ --not matched execute @return = this
exec [this] EXEC [Sales by Year] '12/12/2001', '12/31/2004'
exec this a, b, c
execute [_a thing] *************** *************** ************
kevin -- kevin...
"Kevin Spencer" wrote:
Correction:
(?i)(?:execute| exec)\s+(?:(?:([#@_a-z][#@_$\.0-9a-z]*)(?!\]))|[\[]([#@_a-z][#@_$\.0-9a-z\s]*)[\]])
I had left the '.' character out of the allowable characters. I was going by the SQL Server Books Online reference, which didn't include it in the lists of allowable name characters (probably sinces it isn't exactly part of the name). Also, I had corrected myself where I had "1-9" and made it "0-9" - but I had missed deleting the '1'. That didn't negatively affect the results, but was superfluous.
-- HTH,
Kevin Spencer Microsoft MVP Professional Numbskull
Hard work is a medication for which there is no placebo.
"Kevin Spencer" <ke***@DIESPAMM ERSDIEtakempis. com> wrote in message news:OR******** ******@TK2MSFTN GP04.phx.gbl... > Hi kevin, > > This is what you need: > > (?i)(?:execute| exec)\s+(?:(?:([#@_a-z][#@_$10-9a-z]*)(?!\]))|[\[]([#@_a-z][#@_$10-9a-z\s]*)[\]]) > > If you test your original Regular Expression against the following, you > will see that its flaw lies in its inability to identify the complete > Stored Procedure Name if it has spaces in it: > > SET QUOTED_IDENTIFI ER ON > GO > SET ANSI_NULLS ON > GO > > > execute this > > exec [this] > EXEC [Sales by Year] '12/12/2001', '12/31/2004' > > exec this a, b, c > > execute [_a thing] > > GO > SET QUOTED_IDENTIFI ER OFF > GO > SET ANSI_NULLS ON > GO > > The one I gave you will do this, and will put the Stored Procedure > names > into Group 1 and Group 2 respectively, without the square brackets. > > -- > HTH, > > Kevin Spencer > Microsoft MVP > Professional Numbskull > > Hard work is a medication for which > there is no placebo. > > "kevin" <kw************ *********@fortk noxnational.com > wrote in message > news:01******** *************** ***********@mic rosoft.com... >>I want to return a list of every sp that is called by a given sp, and >> sp_depends is anything but... >> >> The user will have to supply the name of the first/top level SP and >> then >> my >> app will do the rest from there. >> >> My question: >> Will the following expression always work. I have tested it and it >> works >> now, but I am very consistant in my naming convention in SQL SERVER: >> I >> explicitly use a fully qualified name (3 or 4 part e.g: >> MyDB.MySchema.M yTable >> and MyLinkedSrvr.My DB.MySchema.MyT able) and this will need to be used >> by >> others. >> >> The expression: >> (?:(?:exec|exec ute)\s*(?:@\w*\ s*=)?)(?:\s*\[?\w*\]?\.)?(\s*\[?\w*\]?\.)?(\s*\[?\w*\]?) >> >> -- >> kevin... > > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: jaYPee |
last post by:
I have an existing query from MS Access that I want to convert it to
SQL Server Stored Proc. My problem is on how to convert the WHERE
clause.
This is the query from MS Access:
SELECT SchYrSemCourseJoin.SchYrSemCourseID, Students.IDNo,
& ", " & & " " & AS Name,
Program.ProgramTitle, Program.ProgramDesc, SchYrSem.SchYr,
SchYrSem.Sem, SchYrSem.Year, SchYrSem.Section AS Section1,
|
by: Mike Hutton |
last post by:
I have a rather odd problem.
I have a SP which uses temp. tables along the way, and then returns a
table of results:
CREATE PROCEDURE dbo.usp_myproc(
@pNameList VARCHAR(6000)
)
AS
|
by: hicks |
last post by:
I'm trying to invoke a DB2 stored procedure. The stored proc is coded
in C and compiled to a shared library, which has been placed in the
<DB2 dir>/functions directory. The platform is Solaris.
>From the debug log it seems that the stored procedure can't be found,
although I don't know why. Using the control centre, I can see that the
procedure name is defined in the database, however it can not be
invoked.
Can anyone shed any light on...
|
by: Steve |
last post by:
Hi All,
I'm having a tough time converting the following regex.compile patterns
into the new re.compile format. There is also a differences in the
regsub.sub() vs. re.sub()
Could anyone lend a hand?
import regsub
|
by: comp_databases_ms-sqlserver |
last post by:
This post is related to SQL server 2000 and SQL Server 2005 all
editions.
Many of my stored procedures create temporary tables in the code. I
want to find a way to find the query plan for these procs
Repro
--***********************************
use pubs
go
CREATE PROCEDURE Test @percentage int
| |
by: ravindrag |
last post by:
Hi,
I am getting error SQL1131N during sqlj.install_jar(...). There is no useful message in the diag.log (even with diag level 4). I am giving the diag.log entries at the end of this posting (would have been ideal if there was an option to attach the file).
command:
db2 call sqlj.install_jar('file:/home/xyz/abc.jar','def.abc')
response:
SQL1131N DARI (Stored Procedure) process has been terminated abnormally.
SQLSTATE=38503
|
by: db2user24 |
last post by:
I'm trying to invoke a DB2 stored procedure. The stored proc is coded
in C and compiled to a shared library, which has been placed in the
<DB2 dir>/functions directory. The platform is Linux (using 64 bit DB2 UDB).
From the debug log it seems that the stored procedure can't be found,
although I don't know why. I can see that the procedure name is defined in the database, however it can not be invoked.
Can anyone shed any light on what could...
|
by: davinski |
last post by:
Hello, it's been a while since my last post, hope everyone is fine :P
I'm stuck with what seems to be a simple task, but I'm getting confused on how to complete this. Basically, I have been given a stored procedure which nests itself within itself and uses a temporary table to store the data while writing.
The nested stored procedure is used so that it can output the data rows in a db table into an organized tree like
Example 1
1.0...
|
by: mirandacascade |
last post by:
Questions toward the bottom of the post.
Situation is this:
1) Access 97
2) SQL Server 2000
3) The Access app:
a) sets up pass-thru query
b) .SQL property of querydef is a string, the contents of which
comprise the call to a stored proc
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |