Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ky2009
Starting Member
3 Posts |
Posted - 2009-03-19 : 15:56:59
|
| I am new to the sql server environment. I need help to locate source code of a SQL code . I am looking at the following sql statements and have questions:1- Are these ‘dbo.Get***95th’ statements predefined function/subroutine ?2- Are these predefined function/subroutine source codes stored somewhere on the sql server. Where can I find these predefined function/subroutine source codes ? 3- I would like to find out the tables these ‘predefined function/subroutine accessed and the ‘where’ clause of these sql statements. dbo.GetInBps95th(AA.InterfaceID, @StartDate, @EndDate) AS Maxbps_In95 dbo.GetOutBps95th(AA.InterfaceID, @StartDate, @EndDate) AS Maxbps_Out95 dbo.GetMaxBps95th(AA.InterfaceID, @StartDate, @EndDate) AS Maxbps_95Thank you .----------- Original sql starts -------------DECLARE @StartDate DateTimeDECLARE @EndDate DateTimeSET @StartDate = CAST (DATEDIFF(d, 0, DATEADD(d, 1 - day(getdate()), getdate()))as datetime)SET @EndDate = GetDate()SELECT Interfaces.InterfaceId,Nodes.Caption AS NodeName,Nodes.VendorIcon AS Vendor_Icon, Interfaces.Caption AS Interface_Caption,Interfaces.InterfaceIcon AS Interface_Icon,Maxbps_In95,Maxbps_Out95,Maxbps_95FROM Nodes INNER JOIN Interfaces ON (Nodes.NodeID = Interfaces.NodeID)---------------------INNER JOIN ( SELECT InterfaceID, dbo.GetInBps95th(AA.InterfaceID, @StartDate, @EndDate) AS Maxbps_In95 FROM ( SELECT DISTINCT A.InterfaceID FROM dbo.InterfaceTraffic A WHERE A.DateTime >= @StartDate AND A.DateTime <= @EndDate ) AS AA) as RESULT_IN ON (Interfaces.InterfaceID = RESULT_IN.InterfaceID)---------------------INNER JOIN ( SELECT InterfaceID, dbo.GetOutBps95th(AA.InterfaceID, @StartDate, @EndDate) AS Maxbps_Out95 FROM ( SELECT DISTINCT A.InterfaceID FROM dbo.InterfaceTraffic A WHERE A.DateTime >= @StartDate AND A.DateTime <= @EndDate ) AS AA) as RESULT_OUT ON (Interfaces.InterfaceID = RESULT_OUT.InterfaceID)---------------------INNER JOIN ( SELECT InterfaceID, dbo.GetMaxBps95th(AA.InterfaceID, @StartDate, @EndDate) AS Maxbps_95 FROM ( SELECT DISTINCT A.InterfaceID FROM dbo.InterfaceTraffic A WHERE A.DateTime >= @StartDate AND A.DateTime <= @EndDate ) AS AA) as RESULT_MAX ON (Interfaces.InterfaceID = RESULT_MAX.InterfaceID)--------------------- ORDER BY NodeName, Interface_Caption----------- sql ends ------------- |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-03-19 : 16:36:47
|
| One way is to:From Management Studio use the Object Explorer to navigate to the server/database where these reside.Then navigate into Programmability | Functions | Scalar-valued FunctionsF8 toggles object explorer. You may need to "register" your server in the "Registered Servers" tab (Menu | View | Registered Servers)Be One with the OptimizerTG |
 |
|
|
ky2009
Starting Member
3 Posts |
Posted - 2009-03-19 : 16:43:31
|
| TG, Thanks .I will pass this information to my sql server administrator. We are both new to the sql server environment.Thanks again. |
 |
|
|
ky2009
Starting Member
3 Posts |
Posted - 2009-03-19 : 16:58:59
|
| TG, We found them. Thanks. |
 |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2009-03-19 : 18:14:49
|
You're welcome. What happened? Did your DBA jump ship Post back with any followup questionsBe One with the OptimizerTG |
 |
|
|
|
|
|
|
|