Scripts

Technical Article

Search for text in procedures and show context

This script will search for text within stored procedures and udf's. As a bonus, it will also diplay a user-configurable number of lines from each stored proc to show the search text "in context" so you can tell if it is something you need to deal with without having to open every proc manually.

You rated this post out of 5. Change rating

2004-08-30 (first published: )

250 reads

Technical Article

Bulk Insert proc to try out ur optimization skills

This SP can be used for bulk inserting data from an ascii text file onto a table. You have to change the structure, of the temporary table (ITEM_MASTER_TEMP) and the actual table onto which data is inserted, to suit ur needs . I wish you people workout this SP and try to optimize it as […]

You rated this post out of 5. Change rating

2004-08-26 (first published: )

203 reads

Technical Article

Find strings in text of stored procedures

Ussualy this kind of scripts queries sysobjects and syscomments like this:select distinct object_name(O.id)from syscomments as Cjoin sysobjects as O on O.id = C.id and o.type = 'P' -- search string only in stored procedureswhere C.text like '%insert into MyTable%'When the text of stored procedures, triggers, functions is over 4000 characters, it is saved in syscomments […]

You rated this post out of 5. Change rating

2004-08-26

246 reads

Technical Article

Foreign keys chain in a view. It may be useful.

I made this view because I had to generate a sql server database from  an Oracle database and I had to knew the order in which I import tables.This view, which may be improved, contains the foreign key, the primary and detail table, the column and it's position and may be useful in  many situations

You rated this post out of 5. Change rating

2004-08-25 (first published: )

107 reads

Technical Article

Search for a string in a procedure, trigger or fun

This is an extension of two previous scripts, this one will produce a list of ojects that contain the first parameter and not the second. The function works as a table so if the user wants to list only functions, query as: select * from fn_sys_searchobject('text1','text2') where object_type = 'function'

You rated this post out of 5. Change rating

2004-08-19 (first published: )

117 reads

Blogs

Advice I Like: Failure

By

If it fails where you thought it would fail that is not a failure....

Data Conferences – Worth Every Dollar

By

Some of the best career enhancers you can buy.   Why I Go to...

SQL Server 2025 RegEx and AI

By

One of the language changes in SQL Server 2025 that I’ve seen a lot...

Read the latest Blogs

Forums

Select @ for different fields

By bswhipp

I have a need where I need to pass a field name to a...

Getting the Object Code

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Getting the Object Code

T-SQL in SQL Server 2025: Concatenating Strings

By Steve Jones - SSC Editor

Comments posted to this topic are about the item T-SQL in SQL Server 2025:...

Visit the forum

Question of the Day

Getting the Object Code

What happens when I run this on SQL Server 2022 in the AdventureWorks2022 database?

SELECT OBJECT_DEFINITION (OBJECT_ID(N'dbo.uspGetBillofMaterials')) AS [Object Definition]; 
GO 

See possible answers