SQL: Busqueda por nombre y contenido de un SP

Por nombre  o parametros del SP:

CREATE PROCEDURE Find_Text_In_SP
@StringToSearch varchar(100)
AS
SET @StringToSearch = ‘%’ +@StringToSearch + ‘%’
SELECT Distinct SO.Name
FROM sysobjects SO (NOLOCK)
INNER JOIN syscomments SC (NOLOCK) on SO.Id = SC.ID
AND SO.Type = ‘P’
AND SC.Text LIKE @stringtosearch
ORDER BY SO.Name
GO

Por contenido de un SP:

CREATE PROCEDURE Find_SPName_With_Text
@StringToSearch varchar(100)
AS
SET @StringToSearch = ‘%’ + @StringToSearch + ‘%’
SELECT DISTINCT SO.NAME
FROM SYSOBJECTS SO (NOLOCK)
WHERE SO.TYPE = ‘P’
AND SO.NAME LIKE @StringToSearch
ORDER BY SO.Name
GO

 

Anuncios

ASP.Net: Para resaltar una fila (event onmouseover) de un GridView.

protected void grvPersonas_RowCreated(object sender, GridViewRowEventArgs e)
{
// only apply changes if its DataRow
if (e.Row.RowType == DataControlRowType.DataRow)
{
// when mouse is over the row, save original color to new attribute, and change it to highlight yellow color
//e.Row.Attributes.Add(“onmouseover”, “this.originalstyle=this.style.backgroundColor;this.style.backgroundColor=’#FFFFFF’;this.style.cursor=’hand’;”);
e.Row.Attributes.Add(“onmouseover”, “this.style.textDecoration=’underline’;this.style.cursor=’hand’;”);
// when mouse leaves the row, change the bg color to its original value
//e.Row.Attributes.Add(“onmouseout”, “this.style.backgroundColor=this.originalstyle;this.style.cursor=’cursor’;”);
e.Row.Attributes.Add(“onmouseout”, “this.style.textDecoration=’none’;this.style.cursor=’cursor’;”);
}
}

ASP.Net (Ajax) Función para poder mostrar un alert()

protected void ShowAlert(string message)
{
StringBuilder scriptBuidler =
new StringBuilder(@”<script type=’text/javascript’ language=’javascript’>”);
scriptBuidler.Append(@”alert(‘”);
scriptBuidler.Append(message);
scriptBuidler.Append(@”‘);”);
scriptBuidler.Append(@”</script>”);
AjaxControlToolkit.ToolkitScriptManager.RegisterClientScriptBlock
(this, typeof(Page),
“Patient Detail Not Found”,
scriptBuidler.ToString(),
false
);
}