August 16, 2001 at 12:00 am
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/awarren/trythesqlparserobjecttocolorizeyoursql!.asp>http://www.sqlservercentral.com/columnists/awarren/trythesqlparserobjecttocolorizeyoursql!.asp
September 11, 2001 at 7:16 pm
Here is a program I previously wrote would could be adapted to use this SQLParser
It's in two parts, the first part I called DocumentScripts.asp which reads the output from SQL Create Scripts, which are in a subdirectory named /SQLScripts/. It will extract the /* comments */ from the scripts and use them as a summary to describe the file, and make a link to the file itself.
The second part, ShowScripts.aps will read the SQL file, format it to your web style and present it colorized. Both of these would benefit from the SQLParser.
DOCUMENTSCRIPTS.ASP
********************************************
<%@ LANGUAGE="VBScript" %>
<%
'********************************************************************
' Name: DocumentScripts.asp
'
' Purpose: Uses File System Object to read all files on the server
'in the SQLScripts subdirectory of the web site, to
'extract the script name, parameter information,
'dependancy information and all "/* ... */" comment
'blocks from the PRC, JOB, VIW, TRG, and TAB files
'into a dynamic web page and then to present it to the
'client in the desired format, simplifying the documentation
'process when dealing with SQL Scripts which may be output
'enmass from MSSQL Server to the SQLScripts Subdirectory.
'MSSQL 7.0 and below do not allow for the commenting of
'table scripts, so Descriptions and commentary to be added
'to the .TAB files must be added manually, and care must
'be taken to prevent overwriting such manual documentation.
'********************************************************************
Option Explicit
'On Error Resume Next
Response.Buffer = true
Server.ScriptTimeout = 900
%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="sat_style.css">
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function window_onload() {
document.all.item("MyPageHeaderBar").innerHTML = "<Font color=white FACE=HELVETICA><strong> Technical Details SQL Documentation </strong></font>"
}
function makedisplay( strName )
{
var l = "l" + strName
var m = "m" + strName
if (document.all.item(m).style.display == "none")
{
document.all.item(m).style.display = "block";
document.all.item(l).innerHTML = "<font size=1>click to hide</font>";
}
else
{
document.all.item(m).style.display = "none";
document.all.item(l).innerHTML = "<font size=1>click for Parameter & Dependancy Information</font>";
}
}
//-->
</SCRIPT>
</head>
<body class="bgGrey" marginwidth="0" topmargin="0" LANGUAGE=javascript onload="return window_onload()" link="darkblue" vlink="#000000">
<table border="0" cellspacing="0" width="100%" id="tblFooter">
<tr valign="top">
<td>
<table cellpadding="5" cellspacing="0" border="0" width="100%" id="tblLinks">
<tr class="bgGrey">
<td>
<a href="" class="mediumBlue">Put your links here</a> |
<a href="" class="mediumBlue">Put your links here</a>
</td>
<td>
<div align="right">
<span class="mediumGreyBold">
Technical Support:
</span>
<span class="mediumGrey">
Phone Number or email
</span>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table class="bgGrey" cellpadding="0" cellspacing="0" border="0" width="100%" id="tblLogoBar">
<tr valign="top">
<td>
<table cellpadding="0" cellspacing="0" border="0" id="tblLogo">
<tr valign="top">
<td width="10%">
<img height="70" alt="LOGO" src="../images/Logo.gif" width="100" border="0" >
</td>
</tr>
</table>
</td>
<td align="right" valign="bottom">
</td>
</tr>
</table>
<table class="bgDarkGrey" height="20" border="0" cellpadding="0" cellspacing="0" border="0" width="100%" id="tblHeader">
<!-- Header Image -->
<tr>
<td class="bgDarkGrey" height="20" width="100%" align="left" valign="center" id=MyPageHeaderBar Name=MyPageHeaderBar>
<Font color="white" FACE="HELVETICA">
<strong> Page Heading</strong>
</font>
</td>
</tr>
</table>
<table class="bgDarkGrey" height="20" border="0" cellpadding="0" cellspacing="0" border="0" width="100%" id="tblHeaderRI">
<tr class="bgGrey">
<td height="20" width="100%" align="left" valign="center">
<font class="mediumGreyBold"><font size="4"><b> </b></font></font><br>
</td>
</tr>
</table>
<%
Main()
Sub Main
DIM fso
DIM fsoFolder
DIM fsoFiles
DIM fsoFile
DIM strPath
DIM path
DIM trgPath
DIM tabPath
DIM jobPath
DIM viewPath
DIM badPath
DIM file
DIM line
DIM tmpLine
DIM COMMENT
DIM comments
DIM s
DIM d
DIM k
DIM l
DIM t
DIM p
DIM intStart
DIM intEnd
DIM strParameters
DIM strDependancies
DIM strDependancy
DIM strValidExtensions
DIM strDescriptions
strValidExtensions = "PRC,TRG,TAB,JOB,VIW"
strDescriptions = "Stored Procedures,Table Triggers,Tables,Jobs,Views"
DIM arrValidExtensions
DIM arrDescriptions
DIM strName
DIM strExtension
DIM Trash
arrValidExtensions = split( strValidExtensions , "," , -1 , 1 )
arrDescriptions = split( strDescriptions , "," , -1 , 1 )
Set fso = Server.CreateObject("Scripting.FileSystemObject")
badpath = Request.ServerVariables("APPL_PHYSICAL_PATH") & "SQLscripts\BADPATH.TXT"
set fsoFolder = fso.GetFolder(Request.ServerVariables("APPL_PHYSICAL_PATH") & "SQLscripts\")
set fsoFiles = fsoFolder.Files
s = "<ul>"
d = ""
for each fsoFile in fsoFiles
for each k in arrValidExtensions
Comment = 0
strExtension = right(fsoFile.Name,3)
if strExtension = k then
strName = fsoFile.Name
strName = right(strName , len(strName) - 4)
strName = left (strName , len(strName) - 4)
'<a http="#sp_CalcPopulation">sp_CalcPopulation</a>sp_CalcPopulation
s = s & "<li><a href=" & chr(34) & "#" & strName & chr(34) & ">" & strName & "</a>" & chr(13) & chr(10)
end if
next
Next
s = s & "</ul>"
Response.Write s
Response.Flush
for each fsoFile in fsoFiles
for each k in arrValidExtensions
d = ""
Comment = 0
strExtension = right(fsoFile.Name,3)
if strExtension = k then
strName = fsoFile.Name
strName = right(strName , len(strName) - 4)
strName = left (strName , len(strName) - 4)
'<h3><a name="#sp_getAllProducts"></a><a href="ShowScripts.asp?ScriptName=sp_getAllProducts">sp_getAllProducts</a></h3>
d = d & "<hr><h3><a name=" & chr(34) & "#" & strName & chr(34) & "></a><a href=" & chr(34) & "ShowScripts.asp?ScriptName=" & strName & chr(34) & ">" & strName & "</a></h3>" & chr(13) & chr(10)
strPath = Request.ServerVariables("APPL_PHYSICAL_PATH") & "SQLscripts\" & fsoFile.Name
if fso.FileExists( strPath ) then
' open the file</FONT>
set file = fso.opentextfile( strPath , 1 ) 'ForReading
t = ""
'DESCRIPTION:
'Given @Start_IP, this procedure will determine which master record @Start_IP is
'a subnet of, and will calculate the population of the master record and update it.
'
do until file.AtEndOfStream
line = trim( file.ReadLine )
if InStr(line, "--") then
t = t & " " & trim(left(line,InStr(line , "--") - 1))
else
t = t & " " & trim(line)
end if
'Identify an Extended Comment
if Instr( line , "/*" ) then
Comment = 1
end if
'Close an Extended Comment
if Instr( line , "*/" ) and Comment = 1 then
Comment = 0
end if
if Comment = 1 then
line = trim(replace(replace(line,"/*",""),"*/",""))
d = d & "<font size = 1>" & line & "</font>" & chr(13) & chr(10)
end if
loop
while InStr ( t , chr(9))
t = replace ( t , chr(9) , " " )
wend
while InStr ( t , " " )
t = replace ( t , " " , " " )
wend
'PARAMETERS:
'@Start_IP binary(5) = NULL
'
strParameters = "None"
if k = "PRC" then
p = t
intStart = InStr( UCase(p) , "CREATE PROCEDURE")
'trash = mid ( p , intStart, 500)
intStart = intStart + 17 + len(strName) + 1
p = " " & mid ( p , intStart)
intEnd = InStr ( ucase(p) , " AS ")
strParameters = trim ( left ( p , intEnd ) )
if strParameters = "" then
strParameters = "None"
end if
if left ( strParameters , 1 ) = "(" then
strParameters = mid ( trim (strParameters) , 2 , len(trim (strParameters)) - 2 )
end if
strParameters = replace(strParameters,",",", <br>")
strParameters = colorize(UCase(strParameters))
p = ""
end if
strDependancies = "None"
'DEPENDANCIES:
'sp_CalcIPPlusIP
if k <> "TAB" then
p = UCase(t)
strDependancies = ""
while InStr(p," EXEC") or InStr(p," EXECUTE")
'find the first " EXEC" or " EXECUTE"
intStart = InStr( p , " EXEC")
'advance to the beginning of the next word
intStart = InStr( intStart + 5 , p , " " ) + 1
'find the end of it
intEnd = InStr( intStart + 1 , p , " " )
'put that word in strDependancy
strDependancy = mid ( p , intStart , intEnd - intStart )
'if it's a function return call variable
if InStr(strDependancy , "@") then
'then find the "="
intStart = InStr ( intStart , p , "=" ) + 1
'trim everything before the "= " including the "= "
p = trim ( mid ( p , intStart , len(p) ) )
'now get end of the procedure name
intEnd = inStr ( p , " " )
'and put the proc name into strDependancy
strDependancy = trim ( mid ( p , 1 , intEnd ) )
end if
'if the proc name is not already in the dependancy list
if InStr ( strDependancies , strDependancy ) then
else
'add it to the dependancy list
strDependancies = strDependancies & "<br>" & chr(13) & chr(10) & "<font size=1>" & strDependancy & "</font>"
end if
'trim off this proc name from the beginning
p = mid ( p , intEnd + 1 , len(p) )
p = ""
'and find the next
wend
p = UCase(t)
while InStr(p," FROM")
intStart = InStr( p , " FROM")
intStart = InStr( intStart + 5 , p , " " ) + 1
intEnd = InStr( intStart + 1 , p , " " )
strDependancy = mid ( p , intStart , intEnd - intStart )
if InStr ( strDependancies , strDependancy ) then
else
strDependancies = strDependancies & "<br>" & chr(13) & chr(10) & "<font size=1>" & strDependancy & "</font>"
end if
p = mid ( p , intEnd + 1 , len(p) )
p = ""
wend
p = UCase(t)
while InStr(p," INTO")
intStart = InStr( p , " INTO")
intStart = InStr( intStart + 5 , p , " " ) + 1
intEnd = InStr( intStart + 1 , p , " " )
strDependancy = mid ( p , intStart , intEnd - intStart )
if InStr ( strDependancy , "@" ) then
else
if InStr ( strDependancies , strDependancy ) then
else
strDependancies = strDependancies & "<br>" & chr(13) & chr(10) & "<font size=1>" & strDependancy & "</font>"
end if
end if
p = mid ( p , intEnd + 1 , len(p) )
p = ""
wend
p = UCase(t)
while InStr(p," UPDATE")
intStart = InStr( p , " UPDATE")
intStart = InStr( intStart + 7 , p , " " ) + 1
intEnd = InStr( intStart + 1 , p , " " )
strDependancy = mid ( p , intStart , intEnd - intStart )
if InStr ( strDependancies , strDependancy ) then
else
strDependancies = strDependancies & "<br>" & chr(13) & chr(10) & "<font size=1>" & strDependancy & "</font>"
end if
p = mid ( p , intEnd + 1 , len(p) )
p = ""
wend
strDependancies = strDependancies & "<br>"
t = ""
end if
if trim (strDependancies) = "" then
strDependancies = "<font size=1>None</font>"
end if
d = d & "<br>"
d = d & "<span STYLE=" & chr(34) & "cursor:hand;color:mediumblue" & chr(34)
d = d & " id=" & chr(34) & "l" & trim(strName) & chr(34)
d = d & " onclick=" & chr(34) & "makedisplay(" & chr(39) & trim(strName) & chr(39) & ")" & chr(34)
d = d &" onmouseover=" & chr(34) & "this.style.color='#B6D5AA'" & chr(34)
d = d &" onmouseout=" & chr(34) & "this.style.color='mediumblue'" & chr(34)
d = d & ">"
d = d & "<font size = " & chr(34) & "1" & chr(34) & ">click for Parameter & Dependancy Information</font>"
d = d & "</span>"
d = d & "<span style=" & chr(34) & "display:none" & chr(34)
d = d & " id=" & chr(34) & "m" & trim(strName) & chr(34) & ">"
d = d & "<p><font size = " & chr(34) & "1" & chr(34) & ">"
d = d & "<b>Parameters: </b></font>"
d = d & "<font size = " & chr(34) & "1" & chr(34) & ">"
d = d & strParameters & "</font><br>" & chr(13) & chr(10)
d = d & "<p><font size = " & chr(34) & "1" & chr(34) & ">"
d = d & "<b>Dependancies:</b></font>"
d = d & "<font size = " & chr(34) & "1" & chr(34) & ">"
d = d & strDependancies & "</font>" & chr(13) & chr(10)
d = d & "</span>"
' close and clean up
file.close
set file = nothing
d = d & chr(13) & chr(10) & "<p>" & chr(13) & chr(10)
Response.Write d
Response.Flush
end if
end if
next
Next
set fso = nothing
End Sub 'Main
%>
<table border="0" cellspacing="0" width="100%" id="tblFooter">
<tr>
<td width="100%" valign="top" align="left" height="50">
</td>
</tr>
<tr>
<td width="100%" valign="top" align="left" height="4" class="bgDarkGrey">
</td>
</tr>
<tr valign="top">
<td>
<table border="0" cellspacing="0" width="100%" id="tblFooter">
<tr valign="top">
<td>
<table cellpadding="5" cellspacing="0" border="0" width="100%" id="tblLinks">
<tr class="bgGrey">
<td>
<a href="" class="mediumBlue">Put your links here</a> |
<a href="" class="mediumBlue">Put your links here</a>
</td>
<td>
<div align="right">
<span class="mediumGreyBold">
Technical Support:
</span>
<span class="mediumGrey">
Phone Number or email
</span>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<%
function colorize(line)
dim comments
if Instr(line , "--" ) > 0 then
comments = "<font color=darkgreen>" & + right( line , len (line ) - Instr(line , "--" ) + 1 ) & "</font>"
line = left (line , Instr(line , "--" ) - 1 )
else
comments = ""
end if
'line = replace ( line , "--" , "<font color=darkgreen>--" ) & "</font>"
line = replace ( line , "<" , "<font color=gray><</font>" )
line = replace ( line , ">" , "<font color=gray>></font>" )
line = replace ( line , " EXISTS " , " <font color=gray>EXISTS</font> " )
line = replace ( line , CHR(9) & "AND " , CHR(9) & "<font color=gray>AND</font> " )
line = replace ( line , " AND " , " <font color=gray>AND</font> " )
line = replace ( line , " NOT " , " <font color=gray>NOT</font> " )
if Instr( line , "AND " ) = 1 then
line = replace ( line , "AND " , "<font color=gray>AND</font> " )
END IF
line = replace ( line , CHR(9) & "OR " , CHR(9) & "<font color=gray>OR</font> " )
line = replace ( line , " OR " , " <font color=gray>OR</font> " )
if Instr( line , "OR " ) = 1 then
line = replace ( line , "OR " , "<font color=gray>OR</font> " )
END IF
line = replace ( line , "@@FETCH_STATUS" , "<font color=magenta>@@FETCH_STATUS</font>" )
line = replace ( line , "ISNULL" , "<font color=magenta>ISNULL</font>" )
line = replace ( line , "DELETED" , "<font color=magenta>DELETED</font>" )
line = replace ( line , "REPLACE" , "<font color=magenta>REPLACE</font>" )
line = replace ( line , "DATEPART" , "<font color=magenta>DATEPART</font>" )
line = replace ( line , "SUBSTRING" , "<font color=magenta>SUBSTRING</font>" )
line = replace ( line , " LEN" , " <font color=magenta>LEN</font>" )
line = replace ( line , "GETDATE" , "<font color=magenta>GETDATE</font>" )
line = replace ( line , "INSERTED" , "<font color=magenta>INSERTED</font>" )
line = replace ( line , "NULL)" , "<font color=gray>NULL</font>)" )
line = replace ( line , "NULL " , "<font color=gray>NULL</font> " )
line = replace ( line , " NULL" , " <font color=gray>NULL</font>" )
line = replace ( line , "(" , "<font color=gray>(</font>" )
line = replace ( line , ")" , "<font color=gray>)</font>" )
line = replace ( line , CHR(9) & "ELSE", CHR(9) & "<font color=blue>ELSE</font>" )
line = replace ( line , CHR(9) & "ELSE " , CHR(9) & "<font color=blue>ELSE</font> " )
line = replace ( line , " ELSE " , " <font color=blue>ELSE</font> " )
if Instr( line , "ELSE " ) = 1 then
line = replace ( line , "ELSE " , "<font color=blue>ELSE</font> " )
END IF
line = replace ( line , "DROP PROCEDURE " , "<font color=blue>DROP PROCEDURE</font> " )
line = replace ( line , " IF " , " <font color=blue>IF</font> " )
line = replace ( line , CHR(9) & "IF " , CHR(9) & "<font color=blue>IF</font> " )
if Instr( line , "IF " ) = 1 then
line = replace ( line , "IF " , "<font color=blue>IF</font> " )
END IF
line = replace ( line , "VALUES " , "<font color=blue>VALUES</font> " )
line = replace ( line , "CAST " , "<font color=blue>CAST</font> " )
line = replace ( line , "INSERT " , "<font color=blue>INSERT</font> " )
line = replace ( line , "DELETE " , "<font color=blue>DELETE</font> " )
line = replace ( line , "UPDATE " , "<font color=blue>UPDATE</font> " )
line = replace ( line , "SELECT" , "<font color=blue>SELECT</font>" )
line = replace ( line , "GOTO" , "<font color=blue>GOTO</font>" )
line = replace ( line , CHR(9) & "SELECT" , CHR(9) & "<font color=blue>SELECT</font>" )
line = replace ( line , "LIKE" , "<font color=blue>LIKE</font>" )
line = replace ( line , "WHERE" , "<font color=blue>WHERE</font>" )
line = replace ( line , " ORDER " , " <font color=blue>ORDER</font> " )
line = replace ( line , CHR(9) & "ORDER " , CHR(9) & "<font color=blue>ORDER</font> " )
line = replace ( line , "RETURN" , "<font color=blue>RETURN</font>" )
line = replace ( line , "ENDSAVE" , "<font color=blue>ENDSAVE</font>" )
line = replace ( line , chr(9) & "END" , chr(9) & "<font color=blue>END</font>" )
line = replace ( line , "END " , "<font color=blue>END</font> " )
line = replace ( line , "BEGIN" , "<font color=blue>BEGIN</font>" )
line = replace ( line , "OPEN" , "<font color=blue>OPEN</font>" )
line = replace ( line , "DEALLOCATE" , "<font color=blue>DEALLOCATE</font>" )
line = replace ( line , "CLOSE" , "<font color=blue>CLOSE</font>" )
line = replace ( line , "INTO" , "<font color=blue>INTO</font>" )
line = replace ( line , "FETCH " , "<font color=blue>FETCH</font> " )
line = replace ( line , "NEXT" , "<font color=blue>NEXT</font>" )
line = replace ( line , "FROM" , "<font color=blue>FROM</font>" )
line = replace ( line , "COMMIT" , "<font color=blue>COMMIT</font>" )
line = replace ( line , "TRANSACTION" , "<font color=blue>TRANSACTION</font>" )
line = replace ( line , "QUITWITHROLLBACK" , "<font color=blue>QUITWITHROLLBACK</font>" )
line = replace ( line , "ROLLBACK" , "<font color=blue>ROLLBACK</font>" )
line = replace ( line , "WITH " , "<font color=blue>WITH</font> " )
line = replace ( line , "WHILE" , "<font color=blue>WHILE</font>" )
line = replace ( line , "NOLOCK" , "<font color=blue>NOLOCK</font>" )
line = replace ( line , " IS " , " <font color=blue>IS</font> " )
line = replace ( line , " IN " , " <font color=blue>IN</font> " )
line = replace ( line , CHR(9) & "EXEC " , CHR(9) & "<font color=blue>EXEC</font> " )
line = replace ( line , " EXEC " , " <font color=blue>EXEC</font> " )
line = replace ( line , CHR(9) & "EXECUTE " , CHR(9) & "<font color=blue>EXECUTE</font> " )
line = replace ( line , "EXECUTE " , "<font color=blue>EXECUTE</font> " )
line = replace ( line , CHR(9) & "SET " , CHR(9) & "<font color=blue>SET</font> " )
line = replace ( line , " SET " , " <font color=blue>SET</font> " )
if Instr( line , "SET " ) = 1 then
line = replace ( line , "SET " , "<font color=blue>SET</font> " )
END IF
line = replace ( line , "QUOTED_IDENTIFIER" , "<font color=blue>QUOTED_IDENTIFIER</font>" )
line = replace ( line , "ANSI_NULLS" , "<font color=blue>ANSI_NULLS</font>" )
line = replace ( line , " OFF " , " <font color=blue>OFF</font> " )
line = replace ( line , " ON " , " <font color=blue>ON</font> " )
line = replace ( line , " ON" & CHR(13) , " <font color=blue>ON</font>" & CHR(13) )
line = replace ( line , " ON" & CHR(10) , " <font color=blue>ON</font>" & CHR(10) )
line = replace ( line , " ON" & CHR(9) , " <font color=blue>ON</font>" & CHR(9) )
if Instr( line , "ON " ) = 1 then
line = replace ( line , "ON " , "<font color=blue>ON</font> " )
END IF
line = replace ( line , " AS " , " <font color=blue>AS</font> " )
if Instr( line , "AS " ) = 1 then
line = replace ( line , "AS " , "<font color=blue>AS</font> " )
END IF
line = replace ( line , " ELSE " , " <font color=blue>ELSE</font> " )
if Instr( line , "ELSE " ) = 1 then
line = replace ( line , "ELSE " , "<font color=blue>ELSE</font> " )
END IF
line = replace ( line , " ORDER " , " <font color=blue>ORDER</font> " )
if Instr( line , "ORDER " ) = 1 then
line = replace ( line , "ORDER " , "<font color=blue>ORDER</font> " )
END IF
line = replace ( line , " BY " , " <font color=blue>BY</font> " )
if Instr( line , "BY " ) = 1 then
line = replace ( line , "BY " , "<font color=blue>BY</font> " )
END IF
line = replace ( line , " ID " , " <font color=blue>ID</font> " )
line = replace ( line , " ID," , " <font color=blue>ID</font>," )
line = replace ( line , "CHARINDEX" , "<font color=magenta>CHARINDEX</font>" )
line = replace ( line , " CHAR" , " <font color=blue>CHAR</font>" )
line = replace ( line , "VARCHAR" , "<font color=blue>VARCHAR</font>" )
line = replace ( line , "DECLARE" , "<font color=blue>DECLARE</font>" )
line = replace ( line , " BIT" , " <font color=blue>BIT</font>" )
line = replace ( line , " INT" , " <font color=blue>INT</font>" )
line = replace ( line , " SMALLINT" , " <font color=blue>SMALLINT</font>" )
line = replace ( line , " BINARY" , " <font color=blue>BINARY</font>" )
line = replace ( line , "DATETIME" , "<font color=blue>DATETIME</font>" )
line = replace ( line , "ASCII" , "<font color=blue>ASCII</font>" )
line = replace ( line , "NOCOUNT ON" , "<font color=blue>NOCOUNT ON</font>" )
line = replace ( line , "NOCOUNT" , "<font color=blue>NOCOUNT</font>" )
line = replace ( line , "CREATE PROCEDURE " , "<font color=blue>CREATE PROCEDURE</font> " )
line = replace ( line , "(N'" , "(N<font color=RED>'" )
line = replace ( line , "')" , "'</FONT>)" )
line = replace ( line , "ISPROCEDURE" , "<font color=red>ISPROCEDURE</font>" )
line = replace ( line , "ISTABLE" , "<font color=red>ISTABLE</font>" )
line = replace ( line , "ISTRIGGER" , "<font color=red>ISTRIGGER</font>" )
line = replace ( line , "ISINDEX" , "<font color=red>ISINDEX</font>" )
line = replace ( line , "SYSOBJECTS" , "<font color=green>SYSOBJECTS</font>" )
line = replace ( line , "COALESCE" , "<font color=magenta>COALESCE</font>" )
line = replace ( line , "LTRIM" , "<font color=magenta>LTRIM</font>" )
line = replace ( line , "RTRIM" , "<font color=magenta>RTRIM</font>" )
line = replace ( line , "CHARINDEX" , "<font color=magenta>CHARINDEX</font>" )
line = replace ( line , "OBJECT_ID" , "<font color=magenta>OBJECT_ID</font>" )
line = replace ( line , "OBJECTPROPERTY" , "<font color=magenta>OBJECTPROPERTY</font>" )
line = line & " " & comments
comments = ""
colorize = line
'Response.Write("CL:" & line)
end function
%>
********************************************
END DOCUMENTSCRIPTS.ASP
SQLSCRIPTS.ASP
********************************************
<%@ LANGUAGE="VBScript" %>
<%
'********************************************************************
' Name: ShowScripts.asp
'
' Purpose: Uses File System Object to read a file on the server and
'then to present it to the client in the desired format.
'********************************************************************
Option Explicit
'On Error Resume Next
Response.Buffer = true
Main()
Sub Main
DIM fso
DIM path
DIM trgPath
DIM tabPath
DIM jobPath
DIM viewPath
DIM badPath
DIM file
DIM line
DIM tmpLine
DIM AString
DIM InAString
DIM COMMENT
DIM comments
' create the fso object
Set fso = Server.CreateObject("Scripting.FileSystemObject")
path = Request.ServerVariables("APPL_PHYSICAL_PATH") & "SQLscripts\dbo." & Request.QueryString("ScriptName") & ".PRC"
trgPath = Request.ServerVariables("APPL_PHYSICAL_PATH") & "SQLscripts\dbo." & Request.QueryString("ScriptName") & ".TRG"
tabPath = Request.ServerVariables("APPL_PHYSICAL_PATH") & "SQLscripts\dbo." & Request.QueryString("ScriptName") & ".TAB"
jobPath = Request.ServerVariables("APPL_PHYSICAL_PATH") & "SQLscripts\dbo." & Request.QueryString("ScriptName") & ".JOB"
viewPath = Request.ServerVariables("APPL_PHYSICAL_PATH") & "SQLscripts\dbo." & Request.QueryString("ScriptName") & ".VIW"
badpath = Request.ServerVariables("APPL_PHYSICAL_PATH") & "SQLscripts\BADPATH.TXT"
' open the file</FONT>
if fso.FileExists(path) then
set file = fso.opentextfile(path , 1 ) 'ForReading
else
if fso.FileExists(trgPath) then
set file = fso.OpenTextFile(trgPath , 1 )
else
if fso.FileExists(tabpath) then
set file = fso.OpenTextFile(tabpath , 1 )
else
if fso.FileExists(jobpath) then
set file = fso.OpenTextFile(jobpath , 1 )
else
if fso.FileExists(viewPath) then
set file = fso.OpenTextFile(viewPath , 1 )
else
'we have an invalid file
set file = fso.OpenTextFile (badpath , 1 )
end if
end if
end if
end if
end if
%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="sat_style.css">
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function window_onload() {
document.all.item("MyPageHeaderBar").innerHTML = "<Font color=white FACE=HELVETICA><strong> IP Administrator - Technical Details of <%=Request.QueryString("ScriptName")%> </strong></font>"
}
//-->
</SCRIPT>
</head>
<body class="bgGrey" marginwidth="0" topmargin="0" LANGUAGE=javascript onload="return window_onload()" link="darkblue" vlink="#000000">
<table border="0" cellspacing="0" width="100%" id="tblFooter">
<tr valign="top">
<td>
<table cellpadding="5" cellspacing="0" border="0" width="100%" id="tblLinks">
<tr class="bgGrey">
<td>
<a href="" class="mediumBlue">Put your links here</a> |
<a href="" class="mediumBlue">Put your links here</a>
</td>
<td>
<div align="right">
<span class="mediumGreyBold">
Technical Support:
</span>
<span class="mediumGrey">
Phone Number or email
</span>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table class="bgGrey" cellpadding="0" cellspacing="0" border="0" width="100%" id="tblLogoBar">
<tr valign="top">
<td>
<table cellpadding="0" cellspacing="0" border="0" id="tblLogo">
<tr valign="top">
<td width="10%">
<img height="70" alt="LOGO" src="../images/Logo.gif" width="100" border="0" >
</td>
</tr>
</table>
</td>
<td align="right" valign="bottom">
</td>
</tr>
</table>
<table class="bgDarkGrey" height="20" border="0" cellpadding="0" cellspacing="0" border="0" width="100%" id="tblHeader">
<!-- Header Image -->
<tr>
<td class="bgDarkGrey" height="20" width="100%" align="left" valign="center" id=MyPageHeaderBar Name=MyPageHeaderBar>
<Font color="white" FACE="HELVETICA">
<strong> Page Heading</strong>
</font>
</td>
</tr>
</table>
<table class="bgDarkGrey" height="20" border="0" cellpadding="0" cellspacing="0" border="0" width="100%" id="tblHeaderReleasedIPs">
<tr class="bgGrey">
<td height="20" width="100%" align="left" valign="center">
<font class="mediumGreyBold"><font size="4"><b> </b></font></font><br>
</td>
</tr>
</table>
<PRE>
<CODE>
<%
Comment = 0
InAString = 0
do until file.AtEndOfStream
AString = 0
line = UCase( file.ReadLine )
line = normalize (line)
'Identify an Extended Comment
if Instr( line , "/*" ) and InAString = 0 then
line = colorize (left(line, Instr(line , "/*") - 1)) _
& "<font color=darkgreen>/*" _
& right ( line , len ( line ) - Instr(line , "/*" ) -1 )
Comment = 1
end if
'Close an Extended Comment
if Instr( line , "*/" ) and Comment = 1 and InAString = 0 then
line = replace ( line , "*/" , "*/</font>" )
Comment = 0
end if
'Deal with literal strings
if Instr ( line , "'" ) and Comment = 0 then
if Instr (line , "'" ) < Instr ( line , "--" ) or Instr ( line , "--" ) = 0 then
line = replace (line , "'" , "`")
tmpLine = ""
while Instr ( Line , "`" ) > 0
if InAString = 0 then
tmpLine = tmpline & left ( line , Instr( line, "`") - 1)
tmpline = colorize (tmpLine)
line = right ( line , len(line) - Instr ( line , "`" ) + 1 )
line = replace ( line , "`" , "<font color=red>'" , 1 , 1 )
end if
if Instr ( line , "`" ) > 0 then
line = replace ( line , "`" , "'</font>" , 1 , 1 )
InAString = 0
else
InAString = 1
end if
if InAString = 0 then
tmpLine = tmpLine & left ( line , Instr (line , "</font>") + 6 )
'Response.Write(":"&tmpline&":")
line = right (line , len(line) - Instr (line , "</font>") - 6 )
'Response.Write(line)
else
tmpLine = tmpLine & line
line = ""
end if
wend
'Response.Write("1:"&line&":")
line = colorize (line )
'Response.Write("2:"&line&":")
line = tmpLine & line
'Response.Write("3:"&line&":")
AString = 1
end if
end if
'Colorize Everything Else
IF Comment = 0 AND Instr( line , "*/" ) = 0 and AString = 0 and InAString = 0 then
line = colorize (line)
end if
line = crossindex (line)
Response.write( line & "<br>")
loop
' close and clean up
file.close
set file = nothing
set fso = nothing
End Sub 'Main
function normalize (line)
line = replace ( line , " ( " , "(" )
line = replace ( line , " (" , "(" )
line = replace ( line , "( " , "(" )
line = replace ( line , "(" , " ( " )
line = replace ( line , " ) " , ")" )
line = replace ( line , " )" , ")" )
line = replace ( line , ") " , ")" )
line = replace ( line , ")" , " ) " )
line = replace ( line , " = " , "=" )
line = replace ( line , " =" , "=" )
line = replace ( line , "= " , "=" )
line = replace ( line , "=" , " = " )
'line = replace ( line , " < " , "<" )
'line = replace ( line , " <" , "<" )
'line = replace ( line , "< " , "<" )
line = replace ( line , "<" , " < " )
'line = replace ( line , " > " , ">" )
'line = replace ( line , " >" , ">" )
'line = replace ( line , "> " , ">" )
line = replace ( line , ">" , " > " )
line = replace ( line , "< >" , "<> " )
line = replace ( line , "> =" , ">=" )
line = replace ( line , "< =" , "<=" )
normalize = line
End Function
Function crossindex(line)
if Instr( line , "JOB_IP_TBLIPHISTORYARCHIVE" ) > 0 then line = Replace( line , "JOB_IP_TBLIPHISTORYARCHIVE" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=JOB_IP_TBLIPHISTORYARCHIVE'>JOB_IP_TBLIPHISTORYARCHIVE</a>" ) End If
if Instr( line , "SPDELHCWOVCIS" ) > 0 then line = Replace( line , "SPDELHCWOVCIS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SPDELHCWOVCIS'>SPDELHCWOVCIS</a>" ) End If
if Instr( line , "SPDELVPIWOVCIS" ) > 0 then line = Replace( line , "SPDELVPIWOVCIS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SPDELVPIWOVCIS'>SPDELVPIWOVCIS</a>" ) End If
if Instr( line , "SPF_CALCBESTMASK" ) > 0 then line = Replace( line , "SPF_CALCBESTMASK" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SPF_CALCBESTMASK'>SPF_CALCBESTMASK</a>" ) End If
if Instr( line , "SP_ADDADMINISTRATOR" ) > 0 then line = Replace( line , "SP_ADDADMINISTRATOR" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_ADDADMINISTRATOR'>SP_ADDADMINISTRATOR</a>" ) End If
if Instr( line , "SP_ADDPRODUCT" ) > 0 then line = Replace( line , "SP_ADDPRODUCT" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_ADDPRODUCT'>SP_ADDPRODUCT</a>" ) End If
if Instr( line , "SP_ALLOCATEIP" ) > 0 then line = Replace( line , "SP_ALLOCATEIP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_ALLOCATEIP'>SP_ALLOCATEIP</a>" ) End If
if Instr( line , "SP_ARCHIVEIPHISTORY" ) > 0 then line = Replace( line , "SP_ARCHIVEIPHISTORY" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_ARCHIVEIPHISTORY'>SP_ARCHIVEIPHISTORY</a>" ) End If
if Instr( line , "SP_ASSIGNIP" ) > 0 then line = Replace( line , "SP_ASSIGNIP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_ASSIGNIP'>SP_ASSIGNIP</a>" ) End If
if Instr( line , "SP_CALCBESTMASKANDNEXTIP" ) > 0 then line = Replace( line , "SP_CALCBESTMASKANDNEXTIP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_CALCBESTMASKANDNEXTIP'>SP_CALCBESTMASKANDNEXTIP</a>" ) End If
if Instr( line , "SP_CALCIPMINUSIP" ) > 0 then line = Replace( line , "SP_CALCIPMINUSIP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_CALCIPMINUSIP'>SP_CALCIPMINUSIP</a>" ) End If
if Instr( line , "SP_CALCIPORIPINTEGER" ) > 0 then line = Replace( line , "SP_CALCIPORIPINTEGER" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_CALCIPORIPINTEGER'>SP_CALCIPORIPINTEGER</a>" ) End If
if Instr( line , "SP_CALCIPORIPINTEGERTEST" ) > 0 then line = Replace( line , "SP_CALCIPORIPINTEGERTEST" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_CALCIPORIPINTEGERTEST'>SP_CALCIPORIPINTEGERTEST</a>" ) End If
if Instr( line , "SP_CALCIPPLUSIP" ) > 0 then line = Replace( line , "SP_CALCIPPLUSIP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_CALCIPPLUSIP'>SP_CALCIPPLUSIP</a>" ) End If
if Instr( line , "SP_CALCPOPULATION" ) > 0 then line = Replace( line , "SP_CALCPOPULATION" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_CALCPOPULATION'>SP_CALCPOPULATION</a>" ) End If
if Instr( line , "SP_CLREMAILFAILURES" ) > 0 then line = Replace( line , "SP_CLREMAILFAILURES" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_CLREMAILFAILURES'>SP_CLREMAILFAILURES</a>" ) End If
if Instr( line , "SP_CLREMAILSUCCESSES" ) > 0 then line = Replace( line , "SP_CLREMAILSUCCESSES" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_CLREMAILSUCCESSES'>SP_CLREMAILSUCCESSES</a>" ) End If
if Instr( line , "SP_CLRLOGGING" ) > 0 then line = Replace( line , "SP_CLRLOGGING" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_CLRLOGGING'>SP_CLRLOGGING</a>" ) End If
if Instr( line , "SP_CREATEIP" ) > 0 then line = Replace( line , "SP_CREATEIP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_CREATEIP'>SP_CREATEIP</a>" ) End If
if Instr( line , "SP_DEASSIGNIP" ) > 0 then line = Replace( line , "SP_DEASSIGNIP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_DEASSIGNIP'>SP_DEASSIGNIP</a>" ) End If
if Instr( line , "SP_DELETEADMINISTRATOR" ) > 0 then line = Replace( line , "SP_DELETEADMINISTRATOR" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_DELETEADMINISTRATOR'>SP_DELETEADMINISTRATOR</a>" ) End If
if Instr( line , "SP_DELETEIP" ) > 0 then line = Replace( line , "SP_DELETEIP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_DELETEIP'>SP_DELETEIP</a>" ) End If
if Instr( line , "SP_DELETEPRODUCT" ) > 0 then line = Replace( line , "SP_DELETEPRODUCT" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_DELETEPRODUCT'>SP_DELETEPRODUCT</a>" ) End If
if Instr( line , "SP_DISPLAYOAERRORINFO" ) > 0 then line = Replace( line , "SP_DISPLAYOAERRORINFO" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_DISPLAYOAERRORINFO'>SP_DISPLAYOAERRORINFO</a>" ) End If
if Instr( line , "SP_DYNAMIC" ) > 0 then line = Replace( line , "SP_DYNAMIC" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_DYNAMIC'>SP_DYNAMIC</a>" ) End If
if Instr( line , "SP_DYNAMICPROVISIONING" ) > 0 then line = Replace( line , "SP_DYNAMICPROVISIONING" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_DYNAMICPROVISIONING'>SP_DYNAMICPROVISIONING</a>" ) End If
if Instr( line , "SP_EDITADMINISTRATOR" ) > 0 then line = Replace( line , "SP_EDITADMINISTRATOR" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_EDITADMINISTRATOR'>SP_EDITADMINISTRATOR</a>" ) End If
if Instr( line , "SP_EMAILADMINS" ) > 0 then line = Replace( line , "SP_EMAILADMINS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_EMAILADMINS'>SP_EMAILADMINS</a>" ) End If
if Instr( line , "SP_EMAILALERT1" ) > 0 then line = Replace( line , "SP_EMAILALERT1" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_EMAILALERT1'>SP_EMAILALERT1</a>" ) End If
if Instr( line , "SP_EMAILFAILURES" ) > 0 then line = Replace( line , "SP_EMAILFAILURES" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_EMAILFAILURES'>SP_EMAILFAILURES</a>" ) End If
if Instr( line , "SP_EMAILSUCCESSES" ) > 0 then line = Replace( line , "SP_EMAILSUCCESSES" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_EMAILSUCCESSES'>SP_EMAILSUCCESSES</a>" ) End If
if Instr( line , "SP_EMAILSUCCESSESTEST" ) > 0 then line = Replace( line , "SP_EMAILSUCCESSESTEST" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_EMAILSUCCESSESTEST'>SP_EMAILSUCCESSESTEST</a>" ) End If
if Instr( line , "SP_FSOREAD" ) > 0 then line = Replace( line , "SP_FSOREAD" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_FSOREAD'>SP_FSOREAD</a>" ) End If
if Instr( line , "SP_FSOWRITE" ) > 0 then line = Replace( line , "SP_FSOWRITE" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_FSOWRITE'>SP_FSOWRITE</a>" ) End If
if Instr( line , "SP_GETADMINISTRATORS" ) > 0 then line = Replace( line , "SP_GETADMINISTRATORS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETADMINISTRATORS'>SP_GETADMINISTRATORS</a>" ) End If
if Instr( line , "SP_GETALLPRODUCTS" ) > 0 then line = Replace( line , "SP_GETALLPRODUCTS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETALLPRODUCTS'>SP_GETALLPRODUCTS</a>" ) End If
if Instr( line , "SP_GETBESTCIDRBOUNDARY" ) > 0 then line = Replace( line , "SP_GETBESTCIDRBOUNDARY" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETBESTCIDRBOUNDARY'>SP_GETBESTCIDRBOUNDARY</a>" ) End If
if Instr( line , "SP_GETCIDRBOUNDARY" ) > 0 then line = Replace( line , "SP_GETCIDRBOUNDARY" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETCIDRBOUNDARY'>SP_GETCIDRBOUNDARY</a>" ) End If
if Instr( line , "SP_GETEMAILADMINS" ) > 0 then line = Replace( line , "SP_GETEMAILADMINS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETEMAILADMINS'>SP_GETEMAILADMINS</a>" ) End If
if Instr( line , "SP_GETEMAILFAILURES" ) > 0 then line = Replace( line , "SP_GETEMAILFAILURES" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETEMAILFAILURES'>SP_GETEMAILFAILURES</a>" ) End If
if Instr( line , "SP_GETEMAILSUCCESSES" ) > 0 then line = Replace( line , "SP_GETEMAILSUCCESSES" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETEMAILSUCCESSES'>SP_GETEMAILSUCCESSES</a>" ) End If
if Instr( line , "SP_GETGUI_URL" ) > 0 then line = Replace( line , "SP_GETGUI_URL" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETGUI_URL'>SP_GETGUI_URL</a>" ) End If
if Instr( line , "SP_GETHISTORY" ) > 0 then line = Replace( line , "SP_GETHISTORY" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETHISTORY'>SP_GETHISTORY</a>" ) End If
if Instr( line , "SP_GETIPADDRESSES" ) > 0 then line = Replace( line , "SP_GETIPADDRESSES" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETIPADDRESSES'>SP_GETIPADDRESSES</a>" ) End If
if Instr( line , "SP_GETIPADDRESSMASTER" ) > 0 then line = Replace( line , "SP_GETIPADDRESSMASTER" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETIPADDRESSMASTER'>SP_GETIPADDRESSMASTER</a>" ) End If
if Instr( line , "SP_GETIPADDRESSMASTERRF" ) > 0 then line = Replace( line , "SP_GETIPADDRESSMASTERRF" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETIPADDRESSMASTERRF'>SP_GETIPADDRESSMASTERRF</a>" ) End If
if Instr( line , "SP_GETIPADDRESSMASTERRT" ) > 0 then line = Replace( line , "SP_GETIPADDRESSMASTERRT" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETIPADDRESSMASTERRT'>SP_GETIPADDRESSMASTERRT</a>" ) End If
if Instr( line , "SP_GETLOCATIONS" ) > 0 then line = Replace( line , "SP_GETLOCATIONS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETLOCATIONS'>SP_GETLOCATIONS</a>" ) End If
if Instr( line , "SP_GETLOGGING" ) > 0 then line = Replace( line , "SP_GETLOGGING" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETLOGGING'>SP_GETLOGGING</a>" ) End If
if Instr( line , "SP_GETMAILTYPE" ) > 0 then line = Replace( line , "SP_GETMAILTYPE" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETMAILTYPE'>SP_GETMAILTYPE</a>" ) End If
if Instr( line , "SP_GETPRODUCTS" ) > 0 then line = Replace( line , "SP_GETPRODUCTS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETPRODUCTS'>SP_GETPRODUCTS</a>" ) End If
if Instr( line , "SP_GETPROVIDERS" ) > 0 then line = Replace( line , "SP_GETPROVIDERS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETPROVIDERS'>SP_GETPROVIDERS</a>" ) End If
if Instr( line , "SP_GETPROVISIONING" ) > 0 then line = Replace( line , "SP_GETPROVISIONING" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETPROVISIONING'>SP_GETPROVISIONING</a>" ) End If
if Instr( line , "SP_GETROUTERS" ) > 0 then line = Replace( line , "SP_GETROUTERS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETROUTERS'>SP_GETROUTERS</a>" ) End If
if Instr( line , "SP_GETSMTP_UNC" ) > 0 then line = Replace( line , "SP_GETSMTP_UNC" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETSMTP_UNC'>SP_GETSMTP_UNC</a>" ) End If
if Instr( line , "SP_GETSQLSERVER" ) > 0 then line = Replace( line , "SP_GETSQLSERVER" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETSQLSERVER'>SP_GETSQLSERVER</a>" ) End If
if Instr( line , "SP_GETTYPES" ) > 0 then line = Replace( line , "SP_GETTYPES" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_GETTYPES'>SP_GETTYPES</a>" ) End If
if Instr( line , "SP_HEXADECIMAL" ) > 0 then line = Replace( line , "SP_HEXADECIMAL" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_HEXADECIMAL'>SP_HEXADECIMAL</a>" ) End If
if Instr( line , "SP_INITIALIZE_TBLERRORDATA" ) > 0 then line = Replace( line , "SP_INITIALIZE_TBLERRORDATA" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_INITIALIZE_TBLERRORDATA'>SP_INITIALIZE_TBLERRORDATA</a>" ) End If
if Instr( line , "SP_INSERTPRODUCT" ) > 0 then line = Replace( line , "SP_INSERTPRODUCT" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_INSERTPRODUCT'>SP_INSERTPRODUCT</a>" ) End If
if Instr( line , "SP_IPFILLER" ) > 0 then line = Replace( line , "SP_IPFILLER" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_IPFILLER'>SP_IPFILLER</a>" ) End If
if Instr( line , "SP_LOGERROR" ) > 0 then line = Replace( line , "SP_LOGERROR" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_LOGERROR'>SP_LOGERROR</a>" ) End If
if Instr( line , "SP_MRFILLER" ) > 0 then line = Replace( line , "SP_MRFILLER" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_MRFILLER'>SP_MRFILLER</a>" ) End If
if Instr( line , "SP_NEWPRODUCT" ) > 0 then line = Replace( line , "SP_NEWPRODUCT" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_NEWPRODUCT'>SP_NEWPRODUCT</a>" ) End If
if Instr( line , "SP_QALLOCATEIP" ) > 0 then line = Replace( line , "SP_QALLOCATEIP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_QALLOCATEIP'>SP_QALLOCATEIP</a>" ) End If
if Instr( line , "SP_QCREATEIP" ) > 0 then line = Replace( line , "SP_QCREATEIP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_QCREATEIP'>SP_QCREATEIP</a>" ) End If
if Instr( line , "SP_QRELEASEIP" ) > 0 then line = Replace( line , "SP_QRELEASEIP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_QRELEASEIP'>SP_QRELEASEIP</a>" ) End If
if Instr( line , "SP_RECLAIMIP" ) > 0 then line = Replace( line , "SP_RECLAIMIP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_RECLAIMIP'>SP_RECLAIMIP</a>" ) End If
if Instr( line , "SP_RELEASEIP" ) > 0 then line = Replace( line , "SP_RELEASEIP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_RELEASEIP'>SP_RELEASEIP</a>" ) End If
if Instr( line , "SP_REMOVEPRODUCT" ) > 0 then line = Replace( line , "SP_REMOVEPRODUCT" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_REMOVEPRODUCT'>SP_REMOVEPRODUCT</a>" ) End If
if Instr( line , "SP_REPORTMASTERRECORDDETAIL" ) > 0 then line = Replace( line , "SP_REPORTMASTERRECORDDETAIL" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_REPORTMASTERRECORDDETAIL'>SP_REPORTMASTERRECORDDETAIL</a>" ) End If
if Instr( line , "SP_REPORTS" ) > 0 then line = Replace( line , "SP_REPORTS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_REPORTS'>SP_REPORTS</a>" ) End If
if Instr( line , "SP_SETEMAILADMINS" ) > 0 then line = Replace( line , "SP_SETEMAILADMINS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_SETEMAILADMINS'>SP_SETEMAILADMINS</a>" ) End If
if Instr( line , "SP_SETEMAILFAILURES" ) > 0 then line = Replace( line , "SP_SETEMAILFAILURES" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_SETEMAILFAILURES'>SP_SETEMAILFAILURES</a>" ) End If
if Instr( line , "SP_SETEMAILSUCCESSES" ) > 0 then line = Replace( line , "SP_SETEMAILSUCCESSES" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_SETEMAILSUCCESSES'>SP_SETEMAILSUCCESSES</a>" ) End If
if Instr( line , "SP_SETGUI_URL" ) > 0 then line = Replace( line , "SP_SETGUI_URL" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_SETGUI_URL'>SP_SETGUI_URL</a>" ) End If
if Instr( line , "SP_SETLOGGING" ) > 0 then line = Replace( line , "SP_SETLOGGING" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_SETLOGGING'>SP_SETLOGGING</a>" ) End If
if Instr( line , "SP_SETSMTP_UNC" ) > 0 then line = Replace( line , "SP_SETSMTP_UNC" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_SETSMTP_UNC'>SP_SETSMTP_UNC</a>" ) End If
if Instr( line , "SP_SETSQLSERVER" ) > 0 then line = Replace( line , "SP_SETSQLSERVER" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_SETSQLSERVER'>SP_SETSQLSERVER</a>" ) End If
if Instr( line , "SP_SETUSESMTP" ) > 0 then line = Replace( line , "SP_SETUSESMTP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_SETUSESMTP'>SP_SETUSESMTP</a>" ) End If
if Instr( line , "SP_SETUSESQLAGENT" ) > 0 then line = Replace( line , "SP_SETUSESQLAGENT" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_SETUSESQLAGENT'>SP_SETUSESQLAGENT</a>" ) End If
if Instr( line , "SP_SPECIALCASESUBNETS" ) > 0 then line = Replace( line , "SP_SPECIALCASESUBNETS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_SPECIALCASESUBNETS'>SP_SPECIALCASESUBNETS</a>" ) End If
if Instr( line , "SP_TABLESEARCH" ) > 0 then line = Replace( line , "SP_TABLESEARCH" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_TABLESEARCH'>SP_TABLESEARCH</a>" ) End If
if Instr( line , "SP_TABLESEARCH2" ) > 0 then line = Replace( line , "SP_TABLESEARCH2" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_TABLESEARCH2'>SP_TABLESEARCH2</a>" ) End If
if Instr( line , "SP_TRANSFERIPDB2HWCONFIG" ) > 0 then line = Replace( line , "SP_TRANSFERIPDB2HWCONFIG" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_TRANSFERIPDB2HWCONFIG'>SP_TRANSFERIPDB2HWCONFIG</a>" ) End If
if Instr( line , "SP_TRANSFERIPDB2HWCONFIG1" ) > 0 then line = Replace( line , "SP_TRANSFERIPDB2HWCONFIG1" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_TRANSFERIPDB2HWCONFIG1'>SP_TRANSFERIPDB2HWCONFIG1</a>" ) End If
if Instr( line , "SP_TRANSFERIPDB2HWCONFIG2" ) > 0 then line = Replace( line , "SP_TRANSFERIPDB2HWCONFIG2" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_TRANSFERIPDB2HWCONFIG2'>SP_TRANSFERIPDB2HWCONFIG2</a>" ) End If
if Instr( line , "SP_TRANSFERIPDB2HWCONFIG3" ) > 0 then line = Replace( line , "SP_TRANSFERIPDB2HWCONFIG3" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_TRANSFERIPDB2HWCONFIG3'>SP_TRANSFERIPDB2HWCONFIG3</a>" ) End If
if Instr( line , "SP_TRANSFERIPDB2HWCONFIG4" ) > 0 then line = Replace( line , "SP_TRANSFERIPDB2HWCONFIG4" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_TRANSFERIPDB2HWCONFIG4'>SP_TRANSFERIPDB2HWCONFIG4</a>" ) End If
if Instr( line , "SP_TRANSFERIPDB2HWCONFIG5" ) > 0 then line = Replace( line , "SP_TRANSFERIPDB2HWCONFIG5" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_TRANSFERIPDB2HWCONFIG5'>SP_TRANSFERIPDB2HWCONFIG5</a>" ) End If
if Instr( line , "SP_TRANSFERIPDB2HWCONFIG6" ) > 0 then line = Replace( line , "SP_TRANSFERIPDB2HWCONFIG6" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_TRANSFERIPDB2HWCONFIG6'>SP_TRANSFERIPDB2HWCONFIG6</a>" ) End If
if Instr( line , "SP_TRANSFERIPDB2HWCONFIG8" ) > 0 then line = Replace( line , "SP_TRANSFERIPDB2HWCONFIG8" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_TRANSFERIPDB2HWCONFIG8'>SP_TRANSFERIPDB2HWCONFIG8</a>" ) End If
if Instr( line , "SP_UPDATECNCFOOTPRINT_FROM_OUTPUT2" ) > 0 then line = Replace( line , "SP_UPDATECNCFOOTPRINT_FROM_OUTPUT2" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_UPDATECNCFOOTPRINT_FROM_OUTPUT2'>SP_UPDATECNCFOOTPRINT_FROM_OUTPUT2</a>" ) End If
if Instr( line , "SP_VCIMANUAL" ) > 0 then line = Replace( line , "SP_VCIMANUAL" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_VCIMANUAL'>SP_VCIMANUAL</a>" ) End If
if Instr( line , "SP_VCIMGR" ) > 0 then line = Replace( line , "SP_VCIMGR" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=SP_VCIMGR'>SP_VCIMGR</a>" ) End If
if Instr( line , "TABLE_X_IP_RETURN" ) > 0 then line = Replace( line , "TABLE_X_IP_RETURN" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TABLE_X_IP_RETURN'>TABLE_X_IP_RETURN</a>" ) End If
if Instr( line , "TBLCENTRALOFFICE" ) > 0 then line = Replace( line , "TBLCENTRALOFFICE" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLCENTRALOFFICE'>TBLCENTRALOFFICE</a>" ) End If
if Instr( line , "TBLCIRCUITS" ) > 0 then line = Replace( line , "TBLCIRCUITS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLCIRCUITS'>TBLCIRCUITS</a>" ) End If
if Instr( line , "TBLCONFIGURATION" ) > 0 then line = Replace( line , "TBLCONFIGURATION" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLCONFIGURATION'>TBLCONFIGURATION</a>" ) End If
if Instr( line , "TBLERRORDATA" ) > 0 then line = Replace( line , "TBLERRORDATA" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLERRORDATA'>TBLERRORDATA</a>" ) End If
if Instr( line , "TBLHISTORYARCHIVE" ) > 0 then line = Replace( line , "TBLHISTORYARCHIVE" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLHISTORYARCHIVE'>TBLHISTORYARCHIVE</a>" ) End If
if Instr( line , "TBLIPADDRESS" ) > 0 then line = Replace( line , "TBLIPADDRESS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLIPADDRESS'>TBLIPADDRESS</a>" ) End If
if Instr( line , "TBLIPHISTORY" ) > 0 then line = Replace( line , "TBLIPHISTORY" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLIPHISTORY'>TBLIPHISTORY</a>" ) End If
if Instr( line , "TBLIPHISTORYARCHIVE" ) > 0 then line = Replace( line , "TBLIPHISTORYARCHIVE" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLIPHISTORYARCHIVE'>TBLIPHISTORYARCHIVE</a>" ) End If
if Instr( line , "TBLLOCATION" ) > 0 then line = Replace( line , "TBLLOCATION" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLLOCATION'>TBLLOCATION</a>" ) End If
if Instr( line , "TBLLOGINLEVEL" ) > 0 then line = Replace( line , "TBLLOGINLEVEL" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLLOGINLEVEL'>TBLLOGINLEVEL</a>" ) End If
if Instr( line , "TBLNETDATA" ) > 0 then line = Replace( line , "TBLNETDATA" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLNETDATA'>TBLNETDATA</a>" ) End If
if Instr( line , "TBLPLP" ) > 0 then line = Replace( line , "TBLPLP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLPLP'>TBLPLP</a>" ) End If
if Instr( line , "TBLPRODUCT" ) > 0 then line = Replace( line , "TBLPRODUCT" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLPRODUCT'>TBLPRODUCT</a>" ) End If
if Instr( line , "TBLPROVIDER" ) > 0 then line = Replace( line , "TBLPROVIDER" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLPROVIDER'>TBLPROVIDER</a>" ) End If
if Instr( line , "TBLPROVIDERCO" ) > 0 then line = Replace( line , "TBLPROVIDERCO" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLPROVIDERCO'>TBLPROVIDERCO</a>" ) End If
if Instr( line , "TBLPVC" ) > 0 then line = Replace( line , "TBLPVC" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLPVC'>TBLPVC</a>" ) End If
if Instr( line , "TBLROUTERPLP" ) > 0 then line = Replace( line , "TBLROUTERPLP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLROUTERPLP'>TBLROUTERPLP</a>" ) End If
if Instr( line , "TBLROUTER " ) > 0 then line = Replace( line , "TBLROUTER" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLROUTER'>TBLROUTER</a> " ) End If
if Instr( line , "TBLROUTER," ) > 0 then line = Replace( line , "TBLROUTER," , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLROUTER'>TBLROUTER</a>," ) End If
if Instr( line , "TBLROUTER." ) > 0 then line = Replace( line , "TBLROUTER." , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLROUTER'>TBLROUTER</a>." ) End If
if Instr( line , "TBLSECURITYLEVEL" ) > 0 then line = Replace( line , "TBLSECURITYLEVEL" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLSECURITYLEVEL'>TBLSECURITYLEVEL</a>" ) End If
if Instr( line , "TBLTESTSTUFF" ) > 0 then line = Replace( line , "TBLTESTSTUFF" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLTESTSTUFF'>TBLTESTSTUFF</a>" ) End If
if Instr( line , "TBLTYPECONVERSION" ) > 0 then line = Replace( line , "TBLTYPECONVERSION" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLTYPECONVERSION'>TBLTYPECONVERSION</a>" ) End If
if Instr( line , "TBLTYPE " ) > 0 then line = Replace( line , "TBLTYPE" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLTYPE'>TBLTYPE</a>" ) End If
if Instr( line , "TBLVPI" ) > 0 then line = Replace( line , "TBLVPI" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TBLVPI'>TBLVPI</a>" ) End If
if Instr( line , "TESTSP_ALLOCATEIP" ) > 0 then line = Replace( line , "TESTSP_ALLOCATEIP" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TESTSP_ALLOCATEIP'>TESTSP_ALLOCATEIP</a>" ) End If
if Instr( line , "TR_D_PERCENTINUSE" ) > 0 then line = Replace( line , "TR_D_PERCENTINUSE" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TR_D_PERCENTINUSE'>TR_D_PERCENTINUSE</a>" ) End If
if Instr( line , "TR_D_TBLIPADDRESS" ) > 0 then line = Replace( line , "TR_D_TBLIPADDRESS" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TR_D_TBLIPADDRESS'>TR_D_TBLIPADDRESS</a>" ) End If
if Instr( line , "TR_IU_FLDORDERID" ) > 0 then line = Replace( line , "TR_IU_FLDORDERID" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TR_IU_FLDORDERID'>TR_IU_FLDORDERID</a>" ) End If
if Instr( line , "TR_IU_PERCENTINUSE" ) > 0 then line = Replace( line , "TR_IU_PERCENTINUSE" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TR_IU_PERCENTINUSE'>TR_IU_PERCENTINUSE</a>" ) End If
if Instr( line , "TR_I_IPFILLER" ) > 0 then line = Replace( line , "TR_I_IPFILLER" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TR_I_IPFILLER'>TR_I_IPFILLER</a>" ) End If
if Instr( line , "TR_I_TBLIPHISTORY" ) > 0 then line = Replace( line , "TR_I_TBLIPHISTORY" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TR_I_TBLIPHISTORY'>TR_I_TBLIPHISTORY</a>" ) End If
if Instr( line , "TR_TBLROUTERUPDATE_FLDCHANGEDDATE" ) > 0 then line = Replace( line , "TR_TBLROUTERUPDATE_FLDCHANGEDDATE" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TR_TBLROUTERUPDATE_FLDCHANGEDDATE'>TR_TBLROUTERUPDATE_FLDCHANGEDDATE</a>" ) End If
if Instr( line , "TR_U_MASK" ) > 0 then line = Replace( line , "TR_U_MASK" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=TR_U_MASK'>TR_U_MASK</a>" ) End If
if Instr( line , "VPIUPDATE_FLDCHANGEDDATE" ) > 0 then line = Replace( line , "VPIUPDATE_FLDCHANGEDDATE" , "<A HREF='http://darkness.cncx.com:8094/ShowScripts.asp?ScriptName=VPIUPDATE_FLDCHANGEDDATE'>VPIUPDATE_FLDCHANGEDDATE</a>" ) End If
WHILE Instr ( line , " " ) > 0
line = replace (line , " " , " ")
WEND
Crossindex = line
end function
function colorize(line)
dim comments
if Instr(line , "--" ) > 0 then
comments = "<font color=darkgreen>" & + right( line , len (line ) - Instr(line , "--" ) + 1 ) & "</font>"
line = left (line , Instr(line , "--" ) - 1 )
else
comments = ""
end if
'line = replace ( line , "--" , "<font color=darkgreen>--" ) & "</font>"
line = replace ( line , "<" , "<font color=gray><</font>" )
line = replace ( line , ">" , "<font color=gray>></font>" )
line = replace ( line , " EXISTS " , " <font color=gray>EXISTS</font> " )
line = replace ( line , CHR(9) & "AND " , CHR(9) & "<font color=gray>AND</font> " )
line = replace ( line , " AND " , " <font color=gray>AND</font> " )
line = replace ( line , " NOT " , " <font color=gray>NOT</font> " )
if Instr( line , "AND " ) = 1 then
line = replace ( line , "AND " , "<font color=gray>AND</font> " )
END IF
line = replace ( line , CHR(9) & "OR " , CHR(9) & "<font color=gray>OR</font> " )
line = replace ( line , " OR " , " <font color=gray>OR</font> " )
if Instr( line , "OR " ) = 1 then
line = replace ( line , "OR " , "<font color=gray>OR</font> " )
END IF
line = replace ( line , "@@FETCH_STATUS" , "<font color=magenta>@@FETCH_STATUS</font>" )
line = replace ( line , "ISNULL" , "<font color=magenta>ISNULL</font>" )
line = replace ( line , "DELETED" , "<font color=magenta>DELETED</font>" )
line = replace ( line , "REPLACE" , "<font color=magenta>REPLACE</font>" )
line = replace ( line , "DATEPART" , "<font color=magenta>DATEPART</font>" )
line = replace ( line , "SUBSTRING" , "<font color=magenta>SUBSTRING</font>" )
line = replace ( line , " LEN" , " <font color=magenta>LEN</font>" )
line = replace ( line , "GETDATE" , "<font color=magenta>GETDATE</font>" )
line = replace ( line , "INSERTED" , "<font color=magenta>INSERTED</font>" )
line = replace ( line , "NULL)" , "<font color=gray>NULL</font>)" )
line = replace ( line , "NULL " , "<font color=gray>NULL</font> " )
line = replace ( line , " NULL" , " <font color=gray>NULL</font>" )
line = replace ( line , "(" , "<font color=gray>(</font>" )
line = replace ( line , ")" , "<font color=gray>)</font>" )
line = replace ( line , CHR(9) & "ELSE", CHR(9) & "<font color=blue>ELSE</font>" )
line = replace ( line , CHR(9) & "ELSE " , CHR(9) & "<font color=blue>ELSE</font> " )
line = replace ( line , " ELSE " , " <font color=blue>ELSE</font> " )
if Instr( line , "ELSE " ) = 1 then
line = replace ( line , "ELSE " , "<font color=blue>ELSE</font> " )
END IF
line = replace ( line , "DROP PROCEDURE " , "<font color=blue>DROP PROCEDURE</font> " )
line = replace ( line , " IF " , " <font color=blue>IF</font> " )
line = replace ( line , CHR(9) & "IF " , CHR(9) & "<font color=blue>IF</font> " )
if Instr( line , "IF " ) = 1 then
line = replace ( line , "IF " , "<font color=blue>IF</font> " )
END IF
line = replace ( line , "VALUES " , "<font color=blue>VALUES</font> " )
line = replace ( line , "CAST " , "<font color=blue>CAST</font> " )
line = replace ( line , "INSERT " , "<font color=blue>INSERT</font> " )
line = replace ( line , "DELETE " , "<font color=blue>DELETE</font> " )
line = replace ( line , "UPDATE " , "<font color=blue>UPDATE</font> " )
line = replace ( line , "SELECT" , "<font color=blue>SELECT</font>" )
line = replace ( line , "GOTO" , "<font color=blue>GOTO</font>" )
line = replace ( line , CHR(9) & "SELECT" , CHR(9) & "<font color=blue>SELECT</font>" )
line = replace ( line , "LIKE" , "<font color=blue>LIKE</font>" )
line = replace ( line , "WHERE" , "<font color=blue>WHERE</font>" )
line = replace ( line , " ORDER " , " <font color=blue>ORDER</font> " )
line = replace ( line , CHR(9) & "ORDER " , CHR(9) & "<font color=blue>ORDER</font> " )
line = replace ( line , "RETURN" , "<font color=blue>RETURN</font>" )
line = replace ( line , "ENDSAVE" , "<font color=blue>ENDSAVE</font>" )
line = replace ( line , chr(9) & "END" , chr(9) & "<font color=blue>END</font>" )
line = replace ( line , "END " , "<font color=blue>END</font> " )
line = replace ( line , "BEGIN" , "<font color=blue>BEGIN</font>" )
line = replace ( line , "OPEN" , "<font color=blue>OPEN</font>" )
line = replace ( line , "DEALLOCATE" , "<font color=blue>DEALLOCATE</font>" )
line = replace ( line , "CLOSE" , "<font color=blue>CLOSE</font>" )
line = replace ( line , "INTO" , "<font color=blue>INTO</font>" )
line = replace ( line , "FETCH " , "<font color=blue>FETCH</font> " )
line = replace ( line , "NEXT" , "<font color=blue>NEXT</font>" )
line = replace ( line , "FROM" , "<font color=blue>FROM</font>" )
line = replace ( line , "COMMIT" , "<font color=blue>COMMIT</font>" )
line = replace ( line , "TRANSACTION" , "<font color=blue>TRANSACTION</font>" )
line = replace ( line , "QUITWITHROLLBACK" , "<font color=blue>QUITWITHROLLBACK</font>" )
line = replace ( line , "ROLLBACK" , "<font color=blue>ROLLBACK</font>" )
line = replace ( line , "WITH " , "<font color=blue>WITH</font> " )
line = replace ( line , "WHILE" , "<font color=blue>WHILE</font>" )
line = replace ( line , "NOLOCK" , "<font color=blue>NOLOCK</font>" )
line = replace ( line , " IS " , " <font color=blue>IS</font> " )
line = replace ( line , " IN " , " <font color=blue>IN</font> " )
line = replace ( line , CHR(9) & "EXEC " , CHR(9) & "<font color=blue>EXEC</font> " )
line = replace ( line , " EXEC " , " <font color=blue>EXEC</font> " )
line = replace ( line , CHR(9) & "EXECUTE " , CHR(9) & "<font color=blue>EXECUTE</font> " )
line = replace ( line , "EXECUTE " , "<font color=blue>EXECUTE</font> " )
line = replace ( line , CHR(9) & "SET " , CHR(9) & "<font color=blue>SET</font> " )
line = replace ( line , " SET " , " <font color=blue>SET</font> " )
if Instr( line , "SET " ) = 1 then
line = replace ( line , "SET " , "<font color=blue>SET</font> " )
END IF
line = replace ( line , "QUOTED_IDENTIFIER" , "<font color=blue>QUOTED_IDENTIFIER</font>" )
line = replace ( line , "ANSI_NULLS" , "<font color=blue>ANSI_NULLS</font>" )
line = replace ( line , " OFF " , " <font color=blue>OFF</font> " )
line = replace ( line , " ON " , " <font color=blue>ON</font> " )
line = replace ( line , " ON" & CHR(13) , " <font color=blue>ON</font>" & CHR(13) )
line = replace ( line , " ON" & CHR(10) , " <font color=blue>ON</font>" & CHR(10) )
line = replace ( line , " ON" & CHR(9) , " <font color=blue>ON</font>" & CHR(9) )
if Instr( line , "ON " ) = 1 then
line = replace ( line , "ON " , "<font color=blue>ON</font> " )
END IF
line = replace ( line , " AS " , " <font color=blue>AS</font> " )
if Instr( line , "AS " ) = 1 then
line = replace ( line , "AS " , "<font color=blue>AS</font> " )
END IF
line = replace ( line , " ELSE " , " <font color=blue>ELSE</font> " )
if Instr( line , "ELSE " ) = 1 then
line = replace ( line , "ELSE " , "<font color=blue>ELSE</font> " )
END IF
line = replace ( line , " ORDER " , " <font color=blue>ORDER</font> " )
if Instr( line , "ORDER " ) = 1 then
line = replace ( line , "ORDER " , "<font color=blue>ORDER</font> " )
END IF
line = replace ( line , " BY " , " <font color=blue>BY</font> " )
if Instr( line , "BY " ) = 1 then
line = replace ( line , "BY " , "<font color=blue>BY</font> " )
END IF
line = replace ( line , " ID " , " <font color=blue>ID</font> " )
line = replace ( line , " ID," , " <font color=blue>ID</font>," )
line = replace ( line , "CHARINDEX" , "<font color=magenta>CHARINDEX</font>" )
line = replace ( line , " CHAR" , " <font color=blue>CHAR</font>" )
line = replace ( line , "VARCHAR" , "<font color=blue>VARCHAR</font>" )
line = replace ( line , "DECLARE" , "<font color=blue>DECLARE</font>" )
line = replace ( line , " BIT" , " <font color=blue>BIT</font>" )
line = replace ( line , " INT" , " <font color=blue>INT</font>" )
line = replace ( line , " SMALLINT" , " <font color=blue>SMALLINT</font>" )
line = replace ( line , " BINARY" , " <font color=blue>BINARY</font>" )
line = replace ( line , "DATETIME" , "<font color=blue>DATETIME</font>" )
line = replace ( line , "ASCII" , "<font color=blue>ASCII</font>" )
line = replace ( line , "NOCOUNT ON" , "<font color=blue>NOCOUNT ON</font>" )
line = replace ( line , "NOCOUNT" , "<font color=blue>NOCOUNT</font>" )
line = replace ( line , "CREATE PROCEDURE " , "<font color=blue>CREATE PROCEDURE</font> " )
line = replace ( line , "(N'" , "(N<font color=RED>'" )
line = replace ( line , "')" , "'</FONT>)" )
line = replace ( line , "ISPROCEDURE" , "<font color=red>ISPROCEDURE</font>" )
line = replace ( line , "ISTABLE" , "<font color=red>ISTABLE</font>" )
line = replace ( line , "ISTRIGGER" , "<font color=red>ISTRIGGER</font>" )
line = replace ( line , "ISINDEX" , "<font color=red>ISINDEX</font>" )
line = replace ( line , "SYSOBJECTS" , "<font color=green>SYSOBJECTS</font>" )
line = replace ( line , "COALESCE" , "<font color=magenta>COALESCE</font>" )
line = replace ( line , "LTRIM" , "<font color=magenta>LTRIM</font>" )
line = replace ( line , "RTRIM" , "<font color=magenta>RTRIM</font>" )
line = replace ( line , "CHARINDEX" , "<font color=magenta>CHARINDEX</font>" )
line = replace ( line , "OBJECT_ID" , "<font color=magenta>OBJECT_ID</font>" )
line = replace ( line , "OBJECTPROPERTY" , "<font color=magenta>OBJECTPROPERTY</font>" )
line = line & " " & comments
comments = ""
colorize = line
'Response.Write("CL:" & line)
end function
%>
</CODE>
</PRE>
<table border="0" cellspacing="0" width="100%" id="tblFooter">
<tr>
<td width="100%" valign="top" align="left" height="50">
</td>
</tr>
<tr>
<td width="100%" valign="top" align="left" height="4" class="bgDarkGrey">
</td>
</tr>
<tr valign="top">
<td>
<table border="0" cellspacing="0" width="100%" id="tblFooter">
<tr valign="top">
<td>
<table cellpadding="5" cellspacing="0" border="0" width="100%" id="tblLinks">
<tr class="bgGrey">
<td>
<a href="" class="mediumBlue">Put your links here</a> |
<a href="" class="mediumBlue">Put your links here</a>
</td>
<td>
<div align="right">
<span class="mediumGreyBold">
Technical Support:
</span>
<span class="mediumGrey">
Phone Number or email
</span>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
********************************************
END SQLSCRIPTS.ASP
September 11, 2001 at 7:21 pm
February 18, 2002 at 2:35 pm
I have been using TextPad (www.textpad.com) to edit most of my scripts and other text documents, such as batch file, perl, xml, etc.
One of its great features is creating document classes. Each document class can have different syntax highlighting (or as you term it "colorization". ). It highlights keywords, comments, strings, etc. Many have contributed their syntax files in the website, which you can use.
I bumped into TextPad from a SQLServer.Pro article. After using it, I did not know how I survived without it.
February 18, 2002 at 2:48 pm
I used EditPlus. Similar in that you can setup different types of documents and specify which keywords are highlighted, what are comments, etc. http://www.editplus.com
Steve Jones
February 18, 2002 at 3:52 pm
I just tend to stick with Query Analyzer or work in NotePad (yeah just plain old text). And had got curious about this previously. I will say thou in previous experience there were some things I expected to output one way and they did not when the parser returned but right now I cannot remember what. I have an app I started for fun sort of like this and wanted to create a single platform for SQL, Oracle, Informix and Sybase as I work with these often and sometimes use keywords as names (forgetting the differences) or using keywords that are not available.
May 2, 2005 at 7:51 am
I use the the SQL parser object in an application. When I try to parse a SQL statement containing "\", the color codes shows in my richtextbox insted of colorized text.
select field1 + '\' +field2 from table
Any thoughts?
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply