SQL Tools

There are 3 entries for the tag SQL Tools

Search the source of SQL Server views and stored procedures

Ever have to work on a database with a large number of views and you needed to search the content of the objects? Well, here's a query which will allow you to search inside your view objects:DECLARE @search VARCHAR(1000)SET @search = '[text]'SELECT c.[Text]FROM dbo.sysobjects AS vINNER JOIN dbo.syscomments c ON c.id = v.id AND CASE WHEN c.Number > 1 THEN c.Number ELSE 0 END = 0WHERE v.type = 'V' AND c.[Text] LIKE '%' + @search + '%'Just set the value of @search to the value you'd like to find.This was very useful to me as I was trying...

Better Generate Scripts Tool for SQL 2005

Frustrated by the inability to script SQL Server 2005 objects with BOTH a CREATE and DROP statement? Generally, I write all my scripts with both statements and then save them and include them in source control, so this hasn't really been a problem for me. But I recently started working on a new project where stored proceedures haven't been maintained in source control and the generate scripts tool is used to sync changes between environments and there are a lot of stored procedures.So I decided to google for a way to get around this. Greatfully the SqlTeam has created an...

SQL Profiler - Replaying Traces

SQL Profiler has been aptly referred to as the "poor man's load tester".3 months ago I captured trace logs spanning 1 week. My intent was over the summer (our companies "off-season") to use the trace logs to stress test the database to determine the results of server and database configuration changes. Now I'm spending most of my morning trying to replay the trace logs I created using the system stored procedures 3 months ago.Well, here's what I've discovered:The database ID in the trace log has to match the database id of the database on the server where you are replaying...

 

 

Copyright © Mark J. Miller