Hello,
when I look through Informatin_Schema.Routines I can find listings and
scripts for stored procedures and user-defined functions. Besides the
Trigger Manager, where can I find a collective listing of all Triggers in a
DB and the corresponding scripts? What I really want to do is to find a
Trigger that is using a particular UDF. In pseudo code I was hoping to do
something like this:
Select Routine_Name From Information_Schema.TriggerRoutines Where
Routine_Definition Like %dbo.f_someUDF%
Any suggestions appreciated how I can accomplish this.
Thanks,
Rich>What I really want to do is to find a
> Trigger that is using a particular UDF. In pseudo code I was hoping to do
> something like this:
If that's all that you really want to do, assuming that the trigger and the
function are in the same database
SQL 2000:
select DISTINCT OBJECT_NAME([id]) FROM sysdepends
WHERE OBJECT_NAME([depid]) = 'YourFunction'
SQL 2005
SELECT DISTINCT OBJECT_NAME([id]) FROM sys.sql_dependencies
WHERE OBJECT_NAME([referenced_major_id]) = 'YourFunction'
If you posted to this forum through TechNet, and you found my answers
helpful, please mark them as answers.
Showing posts with label user-defined. Show all posts
Showing posts with label user-defined. Show all posts
Wednesday, March 28, 2012
Monday, March 12, 2012
Indexing ?
I have a simple table that includes an ID and 8 user-defined data fields. Th
e
fields are nvarchar(255) and the application allows the user to store any
data they like in them. The application also allows searching on any
combination of up to 5 of the fields, with an AND or OR logical combination.
The query returns the result set unordered.
Does anyone have any thoughts on an indexing scheme for this situation? I'm
not quite sure what is best given that the user may search on any combinatio
n
of fields. Some obvious thoughts are:
1. An separate index on each column.
2. A single index covering all columns.
3. A separate index on each of the 8 choose 5 combinations of columns
(whoah!).
Any thoughts?Although I do not condone this, creating an index on each of the columns
would allow SQL Server to use Index Joining / Intersection to perform the
search. Creating an Index on all the columns would only benefit the
statements that search on the columns in the order of the index.
"Ken" wrote:
> I have a simple table that includes an ID and 8 user-defined data fields.
The
> fields are nvarchar(255) and the application allows the user to store any
> data they like in them. The application also allows searching on any
> combination of up to 5 of the fields, with an AND or OR logical combinatio
n.
> The query returns the result set unordered.
> Does anyone have any thoughts on an indexing scheme for this situation? I'
m
> not quite sure what is best given that the user may search on any combinat
ion
> of fields. Some obvious thoughts are:
> 1. An separate index on each column.
> 2. A single index covering all columns.
> 3. A separate index on each of the 8 choose 5 combinations of columns
> (whoah!).
> Any thoughts?
>
e
fields are nvarchar(255) and the application allows the user to store any
data they like in them. The application also allows searching on any
combination of up to 5 of the fields, with an AND or OR logical combination.
The query returns the result set unordered.
Does anyone have any thoughts on an indexing scheme for this situation? I'm
not quite sure what is best given that the user may search on any combinatio
n
of fields. Some obvious thoughts are:
1. An separate index on each column.
2. A single index covering all columns.
3. A separate index on each of the 8 choose 5 combinations of columns
(whoah!).
Any thoughts?Although I do not condone this, creating an index on each of the columns
would allow SQL Server to use Index Joining / Intersection to perform the
search. Creating an Index on all the columns would only benefit the
statements that search on the columns in the order of the index.
"Ken" wrote:
> I have a simple table that includes an ID and 8 user-defined data fields.
The
> fields are nvarchar(255) and the application allows the user to store any
> data they like in them. The application also allows searching on any
> combination of up to 5 of the fields, with an AND or OR logical combinatio
n.
> The query returns the result set unordered.
> Does anyone have any thoughts on an indexing scheme for this situation? I'
m
> not quite sure what is best given that the user may search on any combinat
ion
> of fields. Some obvious thoughts are:
> 1. An separate index on each column.
> 2. A single index covering all columns.
> 3. A separate index on each of the 8 choose 5 combinations of columns
> (whoah!).
> Any thoughts?
>
Subscribe to:
Posts (Atom)