Tuesday, November 11, 2008

How To search entire database?

While browsing the SQL Server newsgroups, every once in a while, I see a request for a script that can search all the columns of all the tables in a given database for a specific keyword. I never took such posts seriously. But then recently, one of my network administrators was troubleshooting a problem with Microsoft Operations Manager (MOM). MOM uses SQL Server for storing all the computer, alert and performance related information. He narrowed the problem down to something specific, and needed a script that can search all the MOM tables for a specific string. I had no such script handy at that time, so we ended up searching manually.

That's when I really felt the need for such a script and came up with this stored procedure "SearchAllTables". It accepts a search string as input parameter, goes and searches all char, varchar, nchar, nvarchar columns of all tables (only user created tables. System tables are excluded), owned by all users in the current database. Feel free to extend this procedure to search other datatypes.

check out these link


http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm

http://it.toolbox.com/wiki/index.php/Get_Records_from_ANY_table_in_a_Database_Matching_Specified_Value

Sunday, August 3, 2008

With the inclusion of .NET within SQL Server 2005, many people thought that T-SQL would become semi-redundant, and no further updates would be applied

With the inclusion of .NET within SQL Server 2005, many people thought that T-SQL would become semi-redundant, and no further updates would be applied. The functionality that was missing could perhaps be completed through the use of .NET. However, T-SQL code is still the heart and lungs of SQL Server. Set-based processing, in which SQL Server can build query plans, is by far the best option for many queries. With SQL Server 2005, T-SQL has gained some functionality that was previously missing, making it a good choice over its competitors. T-SQL has expanded its horizons with capabilities for pivoting data and ranking rows of data based on ranking criteria, as well as other new functionality required to work with the new XML data type. In this article, you'll see how each of these enhancements works.for complete article check out this link