SQL Stored Procedure to search a complete SQL DB for a string/keyword

Create below SearchSQLDB Stored Procedure by connecting to the target SQL DB in your SQL MGMT studio. [code language=”sql”] CREATE PROC SeachSQlDB ( @SearchPattern nvarchar(100) ) AS BEGIN CREATE TABLE #TempResults (ColumnName nvarchar(300), ColumnValue nvarchar(3000)) SET NOCOUNT ON DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @TempSrchStr nvarchar(110) SET @TableName = ” SET @TempSrchStr = QUOTENAME(‘%’ + @SearchPattern + ‘%’,””) WHILE @TableName IS NOT NULL BEGIN SET @ColumnName = ” SET @TableName = ( SELECT MIN(QUOTENAME(TABLE_SCHEMA) + ‘.’ + QUOTENAME(TABLE_NAME)) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = ‘BASE TABLE’ AND QUOTENAME(TABLE_SCHEMA) + ‘.’ + QUOTENAME(TABLE_NAME) > @TableName AND OBJECTPROPERTY(OBJECT_ID(QUOTENAME(TABLE_SCHEMA) + ‘.’ + QUOTENAME(TABLE_NAME)), ‘IsMSShipped’) = […]

Read more

PowerShell Script to Restrict Application to a Single Instance

Here is a simple Powershell code that checks if a specified process is already running and launches second instance of the application if it’s not already running. [code language=”powershell”] $process = "mspaint" $ret = Get-Process -Name $process -ErrorAction SilentlyContinue if ($ret) { Write-Host "INFO: $process already running, skipping start of another instance of the same process" } else { Write-Host "VERBOSE: Starting $process now" Invoke-Item "$process.exe" } [/code] .

Read more

How to determine a given web page/site is using HTML5 and not its older versions

  Requirement: You are a programmer/web developer/QA tester, you require to ensure that web page designed/tested is using HTML5.  How to find HTML version of Web page: Any browser detects the HTML version of the web pages by reading the very first line of a web page that is a declaration of <!DOCTYPE>.  The <!DOCTYPE> is not an HTML tag. It’s the very first instruction to the browser about what version of HTML the page is written in and/or what version of HTML to be used to render the page correctly. Example:  In below case the web page is using […]

Read more