Set Statistics Profile On Into Table
Jul 23, 2014How can I insert the results of "set statistics profile on" into a table?
View 2 RepliesHow can I insert the results of "set statistics profile on" into a table?
View 2 RepliesWhy is there often such a dramatic discrepancy between the logical reads recorded in the trace file versus the output of STATISTICS IO?
In the server-side trace I have running I found a reporting procedure that shows having 136,949,501 reads (yes, in hundreds of millions), and it's taking 13,508 seconds to complete.
So I pull the code from the trace and execute it via SSMS - it runs < 1 second, and only generates about 4,000 reads (using various different parameters I get the same result)
The execution plan shows nothing unusual
We have a previous SQL 2012 cluster that emails us when a new database is added. I am unable to figure out why we get this error any time we add a new database to it, and also it prevents us from adding a new availability group to this cluster because of this error.
I also am unable to figure out what profile it is talking about as this was setup before me and I am not a DBA.
Trying to create a report... Report should show * documents on hold then depending on the "on-hold type" look in the corresponding table and SELECT a few fields. Here is what I have. Where do I SET the @profile variable to return the profile from my queue table?
DECLARe
@profilevarchar(256)
SELECT
q.[profile],q.on_hold,q.on_hold_message,q.dbc_stateÂ
FROM
QueueASq
[code]...
Hello group.I have an issue, which has bothered me for a while now:I'm wondering why the column statistics, which SQL Server wants me tocreate, if I turn off auto-created statistics, are so important to theoptimizer?Example: from Northwind (with auto create stats off), I do the following:SELECT * FROM Customers WHERE Country = 'Sweden'My query plan show a clustered index scan, which is expected - no indexexists for Country. BUT, the query plan also shows, that the optimizer ismissing a statistic on Country, which tells me, that the optimizer wouldbenefit from knowing this.I cannot see why? (and I've been trying for a while now).If I create the missing statistics, nothing happens in the query plan (andwhy should it?). I could understand it, if the optimizer suggested an indexon Country - this would make sense, but if creating the missing index, queryanalyzer creates the statistics with an empty index, which seems to me to beless than usable.I've been thinking long and hard about this, but haven't been able to reacha conclusion :) It has some relevance to my work, because allowing theoptimizer to create missing statistics limits my options for designingindexes (e.g. covering) for some rather wide tables, so I'm thinking why notturn it off altogether. But I would like to know the consequences - hopesomebody has already delved into this, and knows a good explanation.RgdsJesper
View 5 Replies View RelatedWhat is the unit of the numbers you get in the Time Statistics-part when running a query in Microsoft SQL Server Management Studio with Client Statistics turned on?
Currently I get mostly 0īs, but if I try and *** up a query on purpose I can get
it up to around 30... Is it milliseconds or som made up number based on clockcycles or... ?
I would also like to know if itīs possible to change the precision.
- Nikolaj
hi. i'm trying to make a report in asp that sums up a whole bunch of statistics. the report is quite lengthy and takes about 2 minutes to load. i thought i would solve that problem by making a table to dump the statistics into instead of calculating the statistics every time the report is viewed. this way, the page would just read the table with the statistics already put in it. these statistics would be updated every day or two so i don't need anything up to the minute.however, i have run into a small problem which is actually updating the information in the table. my new table is called OfficeReport and it looks like this:UserID Stat1 Stat2 Stat3 ...... Stat3223 0 0 0 056 0 0 0 072 0 0 0 0this is a query for one of the statistics i am currently using:SELECT DefendantCase.UserID, COUNT(DefendantCase.UserID) AS CountOfUserID FROM DefendantCase LEFT JOIN UserDescription ON DefendantCase.UserID=UserDescription.UserID WHERE UserDescription.Status=1 AND UserDescription.UserType=1GROUP BY DefendantCase.UserIDif i run this query, this is what i get:UserID CountOfUserID54 2160 1052 294 427 22how can i modify this query so its output updates the same UserID column in the OfficeReport table? Thanks!
View 3 Replies View RelatedHi Gurus,
I need you update statistics on table .
Is there any command or stored procedure for this.
Thanks,
ServerTeam
Can I get statistics on which type of DML statements (e.g. insert, delete, update) that are executed by users on a table without creating triggers? I want to be able to show the number of executed statements per statement type. I have tried the 2005 Profiler but it outputs the entire batch statement which makes it a bit more difficult to create statistics.
Rgds
Bob
We recently upgraded one of our servers to SQL 2005 - SP2. This server is a subscriber. Both the publisher and the distributor are SQL 2000. We are now having issues with some of our Snapshot publications.
One of the tables in the publication has statistics created on it - not sure how they were created. This table is small - has a PK on it but no other indexes - this is similar to other tables in the same publication that aren't having issues.
When the snapshot runs each night it tries to recreate these stats on the tables. Since they already exist we get and error saying There are already statistics on table XXX named ZZZ.
We can go in and delete the stats on the table and then replication will go through and recreate them but obviously this isn't something we want to do everyday.
Does anyone have a work around for this??
I can easily find user created stat in a databaseSELECT * FROM DB.sys.stats WHERE user_created=1But how do I determine what tables those stats are in? with over 6000 tables I don't feel like looking through all the tables.
View 2 Replies View RelatedHi,
This is Raj..could anyone pls explain the sql profile and how we will set the row-level locks as a dba.Sorry it is a silly question but sometimes these questions are bugging my mind.
Thnak u in advance.
--Raj
I use the default database called "ASPNETDB.mdf" that is automatically created in Visual Studio Express 2005....
There is an table called "aspnet_Profile" that holds the profile-properties, UserID etc.
There is also another table called "aspnet_Users" that holds all usernames, UserID etc...
No to my problem:
I have a SqlDataSource-control and want to select all users that have the property profile.Color = "Blue"....
How can I write the SQL-part for that?
I am using a SqlDatasource and need to set a SelectParamter to the ProviderUserKey (The GUID of the user when Profiles are enabled)
Can anyone tell me whether it is possible and How?
I am currently using the session state to store it in and then using the session=... to get the value into the parameter.
Is there a direct way of passing this value into a SelectParameter when using a SqlDataSource?
Thanks in advance.
Hi,
Is it necesarry that to run SQL Mail, you need MS Exchange Server as the mail server? Our mail server is MDaemon 2.8. Can anyone tell me what would be the mail profile for MDaemon?
TIA
Wilson
I am using MS SQL 2000 profile function to monitor the a report process. (VB + Crystal+MS SQL)
I notice there are some actions named
as "object created "
what does it mean ?
Hi
Is there any way that I can use an ASP.NET profile variable in a T-SQL parameter?
I need to base a query on the current ASP.NET profile variable for purposes of creating a report.
Thanks
Deon
Hello.When I create a user at the ASP.NET database, I need to insert more fields than the defaults, and I do it like this: Dim customProfile As ProfileCommon = ProfileCommon.Create(CreateUserWizard1.UserName, True)
customProfile.telephone =
(CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("TelephoneText"),
TextBox)).Text(telephone example)Those data are inserted at the DB at the aspnet_Profile table, in the fields PropertyNames & PropertyValuesString, but they are saved together (see image above)
I want to separate those properties in the GridView as long as each property appears in a column, is it possible? Thank you very much, i'm expecting your answers.
Hi,
I use the Table Profile Provider: http://www.asp.net/downloads/sandbox/table-profile-provider-samples/
When I call for example: Profile.FirstName does this access the DB every time this call appears in my code?
Or all the profile is loaded to the cache when the user first loggs on?
thanks
I had a profile element named "Country", however, I want it to be named "CountryId". I can change this in the web.config with no problems, but then I need to update the code manually any place Profile.Country is referenced. Also, it seems I would have to write some SQL to update all the values in the profile table from Country to CountryId. Is there an easier way to do this? I'm using Visual Studio 2005 and SQL Server Express 2005.Thanks,Wes
View 5 Replies View RelatedHi,
I have created a Stored Procedure, under Stored procedures section under Enterprise Manager on SQL server 2000.
Could anybody tell me, how and what are the steps to follow to TRACE the procedure , using SQL PROFILER ?
Please advice me !
Nicol
Hi all. Quick question. I'm using VS2005, C#, aspx page.I'm creating a Profile to store login and password. That part is working... I can call the values (and display them) using this code <%= Profile.login %> and <%=Profile.password %>Now I want to create a Grid View that will connect to the SQL db, see if the login and password value stored in the Profile match that of ones in the SQL db. So if the profile is login: bob password: dog, the grid view will output all application ID numbers associated with the bob and dog. Here is the SQL code...trying to use the <%=Profile.login %> as a filter on the login and password doesn't seem to work...Can anyone tell me what I'm doing wrong? How can I reference a value in the Profile within an SQL statement?SELECT ApplicationStatus.Description, Customer.CustomerName, Application.ApplicationDateFROM Application INNER JOIN ApplicationStatus ON Application.ApplicationStatusID = ApplicationStatus.ApplicationStatusID INNER JOIN Customer ON Application.ApplicationID = Customer.ApplicationID INNER JOIN [User] ON Application.DealerId = [User].UserIdWHERE ([User].LoginId = '<%= Profile.login %>') AND ([User].LoginPwd = '<%= Profile.password %>') AND (ApplicationStatus.Description = 'Pending')
View 2 Replies View RelatedI have created a profile object which is a list to store photoId into an array. (kinda like a shopping cart) which will persist in the list untill manually deleted by the user.I want to use the photo Ids stored in this object in my profile as a parameter for an sql select statement to be displayed into a data grid. What is the best way to go about this... and suggestions... I know you can use a profile property as a parametere in a sqldatasource but Im not sure how to do this for an array.HELP
View 1 Replies View RelatedI created a new MAPI profile on the server, and it seems to work fine with Outlook. I also dropped the previous default MAPI profile.
Now, when I go to the EM SQLAgent Properties, the only MAP profile offered in the SQLMail drop-down is the old, deleted profile. Also, only the old profile comes up with xp_get_MAPI_profiles.
How can I get SQLAgent to recognize that I've set up a new mail profile?
how to create profile use mail in sql2000
View 1 Replies View RelatedWe have a delay between the login and the first statment after the login. I see in the profiler trace that this delay is due to an eventClass "SQLTransaction" and the only information I have about it is that the objectName is "UpdateLoginStats". It is very interesting but this event usually takes 0 time, but when run from one specific user, it takes 10-1000 MS.
View 10 Replies View RelatedHello All, Can someone please help me with this problem. I have created additional profile properties for my users in the aspnet_profile table. One of the properties is named 'Division'. The division property is how I segregate users, for example, my company has multiple divisions and, the information that is displayed is dynamic according to which divison the user belongs to. Amost all of my stored proceedures are filtered by checking the value of Profile.Division of the logged in user. This system works great. The problem is, now I am working on user management and I need to create a Gridview that will display all of the users for a particular division but, I have no idea how to filter a query against the aspnet database to get the results I am looking for. Here is a small example:SELECT aspnet_Users.UserName, aspnet_Profile.PropertyNames, aspnet_Profile.PropertyValuesStringFROM aspnet_Profile INNER JOIN aspnet_Users ON aspnet_Profile.UserId = aspnet_Users.UserId******** Here is the part I need help with *********************WHERE PROFILE.DIVISION = KOr, can it even be done? Can you filter a query on the value of a profile property?Anyone have any ideas?Thanks in adavance for your help
View 2 Replies View RelatedI have looked and tried with no luck on using the Profile.UserName in an SQLDataSource Update select statement. and anyone please help me with this?UpdateCommand="UPDATE tblDocuments SET DocumentTypeID = @DocumentTypeID, DocDescription = @DocDescription, DocLocation = @DocLocation, DocStartDate = @DocStartDate, DocEndDate = @DocEndDate, LastUpdate = GETDATE(), LastUpdateBy = @ProfileUser WHERE (DocumentID = @DocumentID)" <UpdateParameters>
<asp:Parameter Name="DocumentID" />
<asp:Parameter Name="DocumentTypeID" />
<asp:Parameter Name="DocDescription" />
<asp:Parameter Name="DocLocation" />
<asp:Parameter Name="DocStartDate" />
<asp:Parameter Name="DocEndDate" />
<asp:Parameter Name="ClientID" />
<asp:Parameter Name="ProfileUser" />
</UpdateParameters>
Hi everyone,
Do someone know how to save enterprise manager profile to save all the registered servers list -> to install on another computer ? (I have a big server list)
I've didn't find an *.ini file, and i've tried to export Windows Registry keys, but I cannot import them into the second computer.
config : SQL2k - sp4 on Windows 2K
Thanks a lot
asia
does anyone know how i can make it so you can view all the users in the database on a page and there names are clickable with a link and then shows there profile page which is basicly a text box that all users can edit there own.
i have a "users" table and mysite stores there username in a cookie called user for the session.
any help will be very very grateful
I am using sql 2000 SP4 and I am really struggling finding some dead locks. I can enable Startup Parameters T1204 and T3606 which gives me a partial picture.
But then I need to run a profile for deadlocks etc. This is where I have a problem what Events and Data columns do I need?
Also I have an extremely heavy loaded server; if I run a full profile I will grind the server to a halt.
I can get away with running a duration trace and setting duration > 3000. But I find that if I add more events and data columns the duration > 3000 no longer stops the flood.
This is because if the field you are filtering by has no value it will include it in the trace. Which is a real problem.
So has anyone got and advice on how I can set up a profile to help me find dead locking but wont cripple my server.
Many thanks
Hi all,
Could somebody please help me out? I'm running Windows 2000 on my laptop. I opened a new user account and gave it administrative privilegies. I copied the administrative profile to the new account and everything seemed to work except when I tried to open any office application a dialogue appeared prompting me to place the Windows 2000 office CD rom in the drive. Why has this happened? How can rectify this problem since I don't have the CD rom.
Thanks in advance for any help.
Hi, All
Can you add a group of images into the aspnet_profile table as a serialized binary blob?
If so how do you retrieve the image from the blob?