Friday, February 17, 2012
doing a sum on a counted field
i have to use a textbox inside a filtered(for yes) list that are to get
a count of yes. I have to use another list to do the same for NO.
using--Count(Fields!answer.Value). Now i want to perform a calculation
on the counts and for the life of me i cant do it. Since the txtboxes
are not contained in the same grouping i cannot reference them using
ReportItems!txt.value. Is there something i can change in my sql
statement to break out the counts as their own columns' please helpIn RS you could do a conditional sum using IIF:
=Sum( iif(Fields!answer.Value = "YES", 1, 0))
=Sum( iif(Fields!answer.Value = "NO", 1, 0))
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"the finger" <m_kosurko@.hotmail.com> wrote in message
news:1115066710.809917.171580@.z14g2000cwz.googlegroups.com...
>i have a dataset with a column that has 2 values. YES or NO.
> i have to use a textbox inside a filtered(for yes) list that are to get
> a count of yes. I have to use another list to do the same for NO.
> using--Count(Fields!answer.Value). Now i want to perform a calculation
> on the counts and for the life of me i cant do it. Since the txtboxes
> are not contained in the same grouping i cannot reference them using
> ReportItems!txt.value. Is there something i can change in my sql
> statement to break out the counts as their own columns' please help
>
Doing a keyword search inside the contents of the stored procedures of a database
Is there a way in sql to do this:
To get all the stored procedures of a given database, then either
- (1) put all the stored procedures contents (all the scripts inside the SPs) in a single file or
- (2) Put all the scripts that constitute all the SPs in a single big string.
Then search that file (if case 1) or that big string (in case 2) and check if it includes a given input pattern (for example check if includes: mySearchedKeyword)
Thanks a lot
This is fairly straight-forward. Here is one method:
|||Thanks a lot|||SELECT ROUTINE_NAME
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%mySearchedKeyword%'
I need to do the search from a table: myKeyWordsTbl which has only one column and many rows.
So myKeyWordsTbl is like this:
KeyWord1
Keyword2
Keyword3
....
For each row (only 1 column) of the table myKeyWordsTbl. I need to take that row value and search if it exists in any of the stored procedure included in all the databases of that instance.
For each keyword that I find, i need to mention the name of the database, the stored procedure and if possible the line number where that row value occured in the SP.
Any guidelines pls
Thanks a lot.
|||another question pls:
I wanna customize the code:
SELECT ROUTINE_NAME
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%mySearchedKeyword%'
to search all databases and not only the current one.
Thanks.
|||You can use the INFORMATION_SCHEMA view only if the SP text does not exceed 4000 characters otherwise the definition will be truncated. So to account for any length you need to do something like sp_helptext logic. This will work in any version of SQL Server. In SQL Server 2005, you can simply use the OBJECT_DEFINITION meta-data function. This returns the entire definition of any valid object as nvarchar(max) value. See below link for more details.
http://msdn2.microsoft.com/en-us/library/ms176090.aspx
|||Thank youDoing a keyword search inside the contents of the stored procedures of a database
Is there a way in sql to do this:
To get all the stored procedures of a given database, then either
- (1) put all the stored procedures contents (all the scripts inside the SPs) in a single file or
- (2) Put all the scripts that constitute all the SPs in a single big string.
Then search that file (if case 1) or that big string (in case 2) and check if it includes a given input pattern (for example check if includes: mySearchedKeyword)
Thanks a lot
This is fairly straight-forward. Here is one method:
|||Thanks a lot|||SELECT ROUTINE_NAME
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%mySearchedKeyword%'
I need to do the search from a table: myKeyWordsTbl which has only one column and many rows.
So myKeyWordsTbl is like this:
KeyWord1
Keyword2
Keyword3
....
For each row (only 1 column) of the table myKeyWordsTbl. I need to take that row value and search if it exists in any of the stored procedure included in all the databases of that instance.
For each keyword that I find, i need to mention the name of the database, the stored procedure and if possible the line number where that row value occured in the SP.
Any guidelines pls
Thanks a lot.
|||another question pls:
I wanna customize the code:
SELECT ROUTINE_NAME
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%mySearchedKeyword%'
to search all databases and not only the current one.
Thanks.
|||You can use the INFORMATION_SCHEMA view only if the SP text does not exceed 4000 characters otherwise the definition will be truncated. So to account for any length you need to do something like sp_helptext logic. This will work in any version of SQL Server. In SQL Server 2005, you can simply use the OBJECT_DEFINITION meta-data function. This returns the entire definition of any valid object as nvarchar(max) value. See below link for more details.
http://msdn2.microsoft.com/en-us/library/ms176090.aspx
|||Thank you