In my recent job where I am acting as a Jr. Software Engineer .This company works for Educational institution hence their product EMS(Education Management System) .Once I was asked to find a ID of a student in entire database (which has a at least 300 tables) and this type of task has to perform frequently .So I decided to write a Stored Procedure And it works fine. Code is Given Below: USE [yourdbname] GO /****** Object: StoredProcedure [dbo].[SearchAllTables] Script Date: 1/21/2015 11:52:21 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROC [dbo].[SearchAllTables] ( @SearchStr nvarchar(100) ) AS BEGIN DECLARE @Results TABLE(ColumnName nvarchar(370), ColumnValue nvarchar(3630)) SET NOCOUNT ON DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110) SET @TableName = '' SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''') WHILE @TableName IS NOT NULL BEGIN SET @...
Gives you back end support so you save time!