by Bill Sempf
17. May 2006 12:14
I was digging through an older database I am rewriting and I stumbled on this little stored procedure. It uses the internals of SQL Server to search the stored procedures for a provided string. Just one of those bits of code we are all meaning to write but never do.
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
I'm not even sure who wrote it but it seems like something handy to have around.
64ffa98e-04a1-4907-81ea-8f45ad4c7639|0|.0|96d5b379-7e1d-4dac-a6ba-1e50db561b04
Tags:
Biz
by Bill Sempf
4. May 2006 12:09
Do you get the requirement to put the version in the title bar of your apps? I do all the time. With the advent of ClickOnce, though, most apps have TWO version numbers, the Assembly Version, and the Publish Version. If you go by the Publish Version (you aren't alone) you can get the Version number using the System.Deployment.Application namespace. Make sure you import it first, and reference it too.
If ApplicationDeployment.IsNetworkDeployed Then
Me.Text = String.Format("{0}, Version {1}", Me.Text, ApplicationDeployment.CurrentDeployment.CurrentVersion.ToString)
Else
Me.Text = String.Format("{0}, Version {1}.{2}.{3}.{4}", Me.Text, My.Application.Info.Version.Major.ToString, My.Application.Info.Version.Minor.ToString, My.Application.Info.Version.Build.ToString, My.Application.Info.Version.Revision.ToString)
End If
bb2c25ef-6514-4d27-9b39-de15d0821d50|0|.0|96d5b379-7e1d-4dac-a6ba-1e50db561b04
Tags:
Biz | VB