Showing posts with label various. Show all posts
Showing posts with label various. Show all posts

Thursday, March 8, 2012

Data Collector (Collection Sets)

I read the BOL, besides the "Disk Usage" collection set, are there other collection sets to be added? What are the various collections sets that we can add. Can we add performance collection sets? The sproc for adding collections sets

sp_syscollector_create_collection_set

didn't seem to indicate what we types of collections which could be added, unless that was the @.logging_level.

Thanks

The next SQL Server 2008 technology preview provides additional collection sets (System Data Collection Sets) as well as additional collector types. These new collection sets and collector types will expand your options for creating custom collections sets.

dan

|||

To expand a bit on the answer above:

In the current CTP you can create collection sets that use T-SQL collector type. To do that you need to create a collection set using sp_syscollector_create_collection_set and then add items to it using sp_collector_create_collection_item. If you look at BOL topics for those SPs you should see examples of how to do that. If you run into any issues, please reply to this thread.

Regards,

Maciek Sarnowicz

Data Collector (Collection Sets)

I read the BOL, besides the "Disk Usage" collection set, are there other collection sets to be added? What are the various collections sets that we can add. Can we add performance collection sets? The sproc for adding collections sets

sp_syscollector_create_collection_set

didn't seem to indicate what we types of collections which could be added, unless that was the @.logging_level.

Thanks

The next SQL Server 2008 technology preview provides additional collection sets (System Data Collection Sets) as well as additional collector types. These new collection sets and collector types will expand your options for creating custom collections sets.

dan

|||

To expand a bit on the answer above:

In the current CTP you can create collection sets that use T-SQL collector type. To do that you need to create a collection set using sp_syscollector_create_collection_set and then add items to it using sp_collector_create_collection_item. If you look at BOL topics for those SPs you should see examples of how to do that. If you run into any issues, please reply to this thread.

Regards,

Maciek Sarnowicz

Data Collector (Collection Sets)

I read the BOL, besides the "Disk Usage" collection set, are there other collection sets to be added? What are the various collections sets that we can add. Can we add performance collection sets? The sproc for adding collections sets

sp_syscollector_create_collection_set

didn't seem to indicate what we types of collections which could be added, unless that was the @.logging_level.

Thanks

The next SQL Server 2008 technology preview provides additional collection sets (System Data Collection Sets) as well as additional collector types. These new collection sets and collector types will expand your options for creating custom collections sets.

dan

|||

To expand a bit on the answer above:

In the current CTP you can create collection sets that use T-SQL collector type. To do that you need to create a collection set using sp_syscollector_create_collection_set and then add items to it using sp_collector_create_collection_item. If you look at BOL topics for those SPs you should see examples of how to do that. If you run into any issues, please reply to this thread.

Regards,

Maciek Sarnowicz

Data by ID and Getdate function

I am trying to return data by date but I also need to return data by date "and" by ID. I've queried various select statements but always get only one days worth of data and the date is repeated many times. I only want to return data for today only but with ID as the other variable.

For example I want only the shows for today by date and by ID. ID of course being the key in the DB. Below I will show you a code block followed by a text version of what it looks like in the browser when tested.

Code Snippet


<%
set con = Server.CreateObject("ADODB.Connection")
con.Open "File Name=E:\webservice\Kuow\Kuow.UDL"
set recProgram = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT *, Air_Date AS Expr1 FROM T_Programs WHERE (Air_Date = CONVERT(varchar(10), GETDATE(), 101))"

'strSQL = "SELECT *, Air_Date AS Expr1, Unit AS Expr2 FROM T_Programs WHERE (Air_Date = CONVERT(varchar(10), GETDATE(), 101)) AND (Unit = 'TB')"
recProgram.Open strSQL,con
%>

<%
recProgram.Close
con.Close
set recProgram = nothing
set con = nothing
%>


Output:
ID Unit Subject Title Long_Summary Body_Text Related_Events Air_Date AudioLink

(Reading across the screen from left to right)
1234 WK1 Subject Title a summary some body text Event text 4/13/2007 wkdy20070413-a.rm

Here is the URL used for testing:
http://Test Server IP/test/defaultweekday2.asp

I need to be able to append to this URL an ID number so that not only do I get content by Air_Date but also by ID.

http://Test Server IP/test/defaultweekday2.asp?ID=1234

How to do this?

You might want to look in Books Online about the usage of GROUP BY.

Code Snippet

GROUP BY convert( varchar(10), getdate(), 101 )) , Unit

|||Ok I will do that but for now is your example a working example? If not what other examples could I try?|||

It 'should' work IF you change the SELECT to

"SELECT *, Air_Date = convert( varchar(10), getdate(), 101 )), Unit FROM T_Programs WHERE (Air_Date = CONVERT(varchar(10), GETDATE(), 101)) GROUP BY convert( varchar(10), getdate(), 101 )) , Unit"

|||I tested your suggested by replacing the second half of my select query with your code starting with WHERE...

When I tested it I got this

Microsoft OLE DB Provider for SQL Server error '80040e14'

GROUP BY expressions must refer to column names that appear in the select list.

/test/defaultweekday2.asp, line 24

Code Snippet

strSQL = "SELECT *, Air_Date AS Expr1 FROM T_Programs GROUP BY convert( varchar(10), getdate(), 101 )) , Unit"

|||Ok I see what your getting at however I just tested it in my browser and got this:

Microsoft OLE DB Provider for SQL Server error '80040e14'

Line 1: Incorrect syntax near ')'.

/test/defaultweekday2.asp, line 22


Code Snippet

strSQL = "SELECT *, Air_Date = convert( varchar(10), getdate(), 101 )), Unit FROM T_Programs WHERE (Air_Date = CONVERT(varchar(10), GETDATE(), 101)) GROUP BY convert( varchar(10), getdate(), 101 )) , Unit"


I counted the ( ) to make sure there was the correct number of left and rights ones. Does it not like the end of the line or what?|||

As the error message indicates (and you might want to read up on using GROUP BY), any column in the GROUP BY MUST also be in the SELECT list.

Your GROUP BY includes Unit, and the SELECT list does not.

I think that the query I posted earlier 'should' work. But this alteration will not.

GROUP BY requires ALL columns in the SELECT list to EITHER be in the GROUP BY clause, or be aggregations. Trying to select all columns with a [SELECT * ] will not work.

I suggest that you start out small, perhaps with the query that I posted earlier, try to understand how GROUP BY works, and then expand your query a small piece at a time.

|||Arnie -

Sounds good. I'm reading up on it now as I learn and thank you for your most recent reply. Your thinking is helping me think. I'm sure it's obvious I'm new to SQL. I'll be glad when I get good enough that I can provide the people I work for and with the answers they seek in a relatively quick turnaround.

There is nothing worse then having work that is over your head and your figuring out how to do it while your solving real world business problems. Can be stressful. But hey it's one way to ensure I'll remember it.

Tuesday, February 14, 2012

Customizing the Job Activity Monitor

Hey, all!
There is a lot of useful info in the various windows within SSMS. However, I
don't personally want to see all the columns and/or data in, say, the Job
Activity Monitor. Is there any way to customize the view by removing columns?
And, is there any way to get my column order and filters to "stick" once I close
SSMS? Thanks for your help.You can't really customize it, no. But the information it uses comes from
very simple queries against catalog views and DMVs in msdb (you can just set
up profiler to trace when you launch the activity monitor, and it will show
you the queries). You could probably build your own little win form GUI
pretty easily, with the functionality you want, using VB.Net or C#.
On 4/30/08 9:52 AM, in article ON9vwlsqIHA.672@.TK2MSFTNGP02.phx.gbl,
"Darrell61" <Darrell.Wright.nospam@.okc.gov> wrote:
> Hey, all!
> There is a lot of useful info in the various windows within SSMS. However, I
> don't personally want to see all the columns and/or data in, say, the Job
> Activity Monitor. Is there any way to customize the view by removing columns?
> And, is there any way to get my column order and filters to "stick" once I
> close
> SSMS? Thanks for your help.