Quantcast
Channel: SQL Server Database Engine forum
Viewing all 12963 articles
Browse latest View live

SQL Server 2005 and MSDTC use

$
0
0

Hi All, 

We have MSDTC installed as a Clustered resource in SQL Server 2005 environment. I know MSDTC is used for cross-database and distributed transactions.

I wanted to know:
1. Even if there are no distributed transactions, I heard there is a known issue with SQL 2005 Database engine which enlists(makes use of) MSDTC. Is this true and when?

2. We are going to implement DB mirroring. What has to be considered with regards to how MSDTC is used in case of Disaster recovery? Will there be any transactions mismatch etc?

Thanks, 
Regards,

Mandar


how to count same column number with same id

$
0
0

Hello, everybody actually i want to count the same value of multiple row with same id.

Idclassname Value Para_id

1 carVersion Audi A4 1.8 TFSI Multitronic 1

3 mileage  Mileage1

8 communication  USB Compatibility 3

16 door Conventional door4

22 carVersion Audi A4 1.8 TFSI Multitronic 4

24 carVersion Audi A4 1.8 TFSI Multitronic 4

14 economy 2.13 lakhs 4

19 lock Child Safety Lock4

see the above table in the last column para_id repeated for example see the para_id 4 and classname for this is door, carversion, carversion.

From that i want to fire the query whose give the para_id=4 and and from the classname query count the which class is more repeated.

In about query output will be Para_id=4 and classname=carversion because carversion is repeated twise. Such query i want fire. If anybody know how to do this plz replay with query.

Running SQL Agent job as proxy user and accessing two different sql servers - does proxy need to be on both?

$
0
0

I have a job that runs on server A.  The job runs a package which access databases on both A and B.  There is a proxy user defined on server A.  Does it also need to be on B?

November on TechNet: Calling All SQL DBE Gurus - Enlighten Us!

$
0
0

"An influential teacher, or popular expert"

 

Oh mighty reader, we need your enlightenment!

Only YOU can show us... the TRUE WAY to code!

 

Win the love and adoration of generations to come, by giving something back to those less awesome.

Show your technical prowess, and divine knowledge of your craft.

Teach us good code from bad.

Show us the way (or the work-around)

We can offer you the very best platform that you need to preach these good words.

Join us and lead this technical community in a whole new way, into a brighter future!

 

Become a TechNet Guru and you may find your own life also significantly enriched!

Win awards, interviews, invites, reviews, medals, friends, recognition points, high fives, hugs, smiles, and so much more!

All you have to do is add an article to TechNet Wiki from your own specialist field. Something that fits into one of the categories listed on the submissions page. Copy in your own blog posts, a forum solution, a white paper, or just something you had to solve for your own day's work today.

Drop us some nifty knowledge, or superb snippets, and become MICROSOFT TECHNOLOGY GURU OF THE MONTH!

This is an official Microsoft TechNet recognition, where people such as yourselves can truly get noticed!

 

HOW TO WIN

1) Please copy over your Microsoft technical solutions and revelations toTechNet Wiki.

2) Add a link to it on THIS WIKI COMPETITION PAGE (so we know you've contributed)

3) Every month, we will highlight your contributions, and select a "Guru of the Month" in each technology.

 

If you win, we will sing your praises in blogs and forums, similar to the weekly contributor awards. Once "on our radar" and making your mark, you will probably be interviewed for your greatness, and maybe eventually even invited into other inner TechNet/MSDN circles!

 

Winning this award in your favoured technology at least once is fast becoming a MUST HAVE!

 

Feel free to ask any questions below.

 

More about TechNet Guru Awards

Thanks in advance!
Pete Laker


#PEJL

Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over to the one and onlyTechNet Wiki, for future generations to benefit from! You'll never get archived again!

If you are a member of any user groups, please make sure you list them in the Microsoft User Groups Portal. Microsoft are trying to help promote your groups, and collating them here is the first step.





#PEJL

Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over to the one and onlyTechNet Wiki, for future generations to benefit from! You'll never get archived again!

If you are a member of any user groups, please make sure you list them in the Microsoft User Groups Portal. Microsoft are trying to help promote your groups, and collating them here is the first step.

Cant Able to restore .bak file

$
0
0

Hi,

When i try to restore my bak file am getting below mentioned error...This shows am using different version of SSMS.....any one suggest how to update my SSMS with10.00.2531........


Thanks SABARINATHAN87

How to repair corrupt SQL 2005 Database

$
0
0

We have recovered from RAID5 server the SQL 2005 database, which are not attaching.

There are more than dozen databases under master.

Please help to resolve this problem.

Suspected problem with identity seed on SQL Server 2012 Standard

$
0
0

SQL Server version 11.0.3128. I have an automated process (job, stored procedure) that inserts DMV data into database tables every half hour. It has run without incident for well over a month. On Nov. 14, the 19:20 run failed with 46 instances of "Violation of primary key constraint ... cannot insert duplicate key ..." into one of the tables. The key of the table is an identity, type integer, start 1 increment 1, values attempted for insert 317211 - 317256. The 19:50 run ran fine.

Looking at the table I can see rows with the identity column, values 317211 - 317256, timestamped at 18:50. Looks like the error message is valid, the identity key values attempted for insert were already used.

There is a daily job running at 19:00 that takes 5 or 6 minutes, it runs dbcc checkdb, reorgs all indexes, and updates all statistics, for many databases.

Did I happen across a rarely-occuring bug?

SQL Server memory term "Target" mean?

$
0
0
Hi Everyone,

Can anybody explain what the term "Target" means dbcc memorystatus. Is this the amount of RAM installed on my box? I get so confused with this term and think it as Target Server memory perfmon counter. From KB http://support.microsoft.com/kb/271624/en-us

Target:- The target committed count, or how big the buffer pool would like to be

Can anyone elaborate on this? Also, I have read that when there is low physical memory or low VAS pressure , the Target is recalculated.

Again, on 32-bit sql server box's , if AWE is enabled at SQL Level, will Target gets changed?

Appreciate if anyone can explain the Term "target" by taking some real numbers to make it easy to understand.

Thanks in Advance.



Server Audit fails to re-start

$
0
0

Hi,

I have created 3 Server audits on a SQL 2012 Enterprise Server to capture Read, Change and Execute separately. Initially I created them with 'Max_Files' value of 10. The Change and Execute went on well however the Read audit filled up pretty quick and started throwing error : SQL Server Audit could not write to file 'D:\Server Audit Files\Data_Read_Audit_xxxxxxxxxx.sqlaudit'.

I dropped and recreated the Read audit with Max_Rollover_Files = 20 instead but it keeps throwing error: Audit 'Read_Audit' failed to start. For more information, see the SQL Server error log. You can also query sys.dm_os_ring_buffers where ring_buffer_type = 'RING_BUFFER_XE_LOG'.

There was no record in the SQL error log and the dmv reported the following:

ring_buffer_addressring_buffer_typetimestamprecord
0x000000207D073CF0RING_BUFFER_XE_LOG205465268<Record id = "3" type ="RING_BUFFER_XE_LOG" time ="205465268"><XE_LogRecord message="file: file create or open failed (last error: 0)"></XE_LogRecord></Record>
0x000000207D073CF0RING_BUFFER_XE_LOG205451035<Record id = "2" type ="RING_BUFFER_XE_LOG" time ="205451035"><XE_LogRecord message="file: file create or open failed (last error: 0)"></XE_LogRecord></Record>
0x000000207D073CF0RING_BUFFER_XE_LOG201852211<Record id = "1" type ="RING_BUFFER_XE_LOG" time ="201852211"><XE_LogRecord message="file: file create or open failed (last error: 0)"></XE_LogRecord></Record>
0x000000207D073CF0RING_BUFFER_XE_LOG31185<Record id = "0" type ="RING_BUFFER_XE_LOG" time ="31185"><XE_LogRecord message="XE engine initialized"></XE_LogRecord></Record>

To check if this happens to other audits, I dropped and recreated the other two audits but they started without any problem. 

What could possibly go wrong with the Read audit? How could it be started clean?

Thanks in advance.

Nirupam


SQL Server Agent does not start

$
0
0

Hi,

Up until now SQL Server Agent was running. I stopped it and tried to Start again today and since then it does not Start again. I right click on SQL Server Agent then I click on Start. The Process starts and when the process bar shows that it is finished there is nothing happening, the Server Agent remains Stopped.There is no error message.

Any suggestion what I need to check or set to be able to Start it again?

Thanks

Suhi


Have a lot of customers -> which design should be chosen (one or multiple instances).

$
0
0

Hi!

I'm a little bit confused with this task, but it should be done.
So, we have a lot of customers who should use SQL server for their applications.
Design is standard and simply:

Customer -> Remote Desktop -> AppServer -> SQL Server

So, now we plan create SQL cluster (active/passive or active/active/passive btw which is preffered?) and we are don't know which design for this solution will be the best.

For example we have 50 customers who wants to use DBE/Reporting/Analysis.
What your offers about SQL design for solve this case?

Thanks!

importing pipe delimited files without creating tables

$
0
0

Hi,

i am looking to import about 40 pipe delimited files, each will have 5 or 6 columns, i dont want to create 40 tables and 200 fields, is there way to import the files without first specifying the table and fields, so that tables and fields are created automatically on the fly as files are importing, also note i am using sql server 2012 express with no SSIS

any help will be much appreciated

thanks

 

Microsoft TechNet Wiki SQL DBE Guru - Winners for October!!

$
0
0

The results for October's TechNet Guru competition have been posted!

http://blogs.technet.com/b/wikininjas/archive/2013/11/17/technet-guru-awards-october-2013.aspx

 

Congratulations to all our new Gurus for October!

We will be interviewing some of the winners and highlighting their achievements, as the month unfolds.

 

Post your NOVEMBER contributions here:

http://social.technet.microsoft.com/wiki/contents/articles/20729.technet-guru-contributions-for-november-2013.aspx

Read all about November's competition in the stickied post in this forum.

 

Below is a copy of the October winners. The last column being a few of the comments from the judges.

Unfortunately, runners up and comments had to be trimmed from this post, to fit into the forum's 60,000 character limit.

 

Guru Award BizTalk Technical Guru - October 2013  

Gold Award Winner

 

Steef-Jan WiggersBizTalk Server 2013: Connect to Window Azure Blob StorageMandi Ohlinger: "Great "How To" guide! Thank you for including the steps on the Windows Azure Management Portal."
Ed Price: "Steef-Jan gets the edge this month for a fantastic article that focuses on a timely topic... BizTalk 2013 connecting to Windows Azure. An incredibly important senario as Microsoft looks at the future, and it looks a little cloudy." 

Silver Award Winner

 

Leonid GanalineBizTalk Integration Development ArchitectureTord Glad Nordahl: "This is one amazing article! Leonid has really put all his knowledge and time into this rticle! Well done, my favorite this month!"
Ed Price: "Leonid's article features great explanations and diagrams!"

Bronze Award Winner

 

Maheshkumar S TiwariBizTalk Server: N1 Loop MappingMandi Ohlinger: "Makes an N1 Loop look easy. Nice addition to the Wiki!"
Ed Price: "Very thorough look at N1 Loop Mapping! Great article!" 


 

Guru Award SharePoint 2010 / 2013 Technical Guru - October 2013  

Gold Award Winner

 

Dan ChristianSharePoint 2013: A no Code Solution to Build a Change Management RequestGokan Ozcifci: "I've been always fan of "no code" solutions for SharePoint Server. This is an impressive post with many images and videos at the same time. The Change Management Request has been explained very well. This articles deserves absolutely the first place! Well done Dan!"
Ed Price: "The amount of information here is astonishing... information, videos, and images... it's incredibly impressive! The screenshots sometimes look like headers (making speed reading a bit of a challenge), but if you move through it slowly, you'll understand every concept as Dan presents it! "

Silver Award Winner

 

Matthew YarlettSharePoint 2010: Storing Database Connection Settings in the Secure StoreEd Price: "Beautiful images, code, and formatting with thorough directions."
Gokan Ozcifci: "This article describes on a very detailed way how to store Database Connection Settings in the Secure Store Services on SharePoint! It has been written with an easy English who makes this article easier to understand! "

Bronze Award Winner

 

Benoît JesterSharePoint 2013 : Upgrade a Site Collection (UI and PowerShell)Jinchun Chen: "Good practises and tips."
Ed Price: "Benoit's article is a common scenario, and the formatting allows you to move through the TOC seamlessly. This is also a good example of looking at the topic from different perspectives."
Gokan Ozcifci: "Great step-by-step Benoit! This article is structured and shows the upgrade in many ways! "


 

Guru Award Small Basic Technical Guru - October 2013  

Gold Award Winner

 

Nonki TakahashiSmall Basic: How to Rotate a Shape Not from the CenterRZ: "This is a very nicely done example showcasing the capabilities of GraphicsWindow"
Ed Price: "Nonki scores again, with another fantastic article! This one goes in depth in rotating objects, including great diagrams to explain the concepts clearly!"

Silver Award Winner

 

litdevSmall Basic: Grammar BasicsEd Price: "All three articles this month have fantastic formatting! LitDev's article digs into the core language elements. Jibba Jabba says in the comments: "It's good to know the language of programmers because every book you read on programming uses these terms. ""
RZ: "Good introduction. Well organized."

Bronze Award Winner

 

Florian AuerSmall Basic: Read and Write CSV FilesEd Price: "Florian's first article features flawless formatting and a great scenario! Jibba Jabba wrote in the comments: "Excellent article. Really helpful stuff." "
RZ: "Very good examples, with nice comments to go with code."


 

Guru Award SQL BI and Power BI (SSAS, SSIS, SSRS, Power Pivot) Technical Guru - October 2013  

Gold Award Winner

 

Jason BruggerUsing a View to Mask Multi-Server SSIS Package ConfigurationsKU: "Nice work. "
NN: "Very good technical article with clear explanations"
Ed Price: "Fantastic formatting, great explanations, and great work on the code formatting. An SSIS article takes the top spot this month!" 

Silver Award Winner

 

MNisharMSDNExists v.s Existing and Auto Exist in MDXKU: "Content is well structured and to the point."
NN: "Great and comprehensive article"
Ed Price: "The images and table are very helpful!"

Bronze Award Winner

 

SathyanarrayananSSSRS - SortingEd Price: "Sorting is very common, and this is a good walk through. As Kay mentions, don't forget to break up articles with a header and TOC. And from the article comments... Saeid: "High quality article!" "
NN: "Very good and thorough explanations"
KU: "Longer articles can benefit from headings or similar tags that help the reader quickly jump to the sections of interest. "

 

Guru Award Transact-SQL Technical Guru - October 2013  

Gold Award Winner

 

Naomi NT-SQL Useful LinksSamuel Lester: "A treasure trove of amazing resources! I've already found myself referencing your "T-SQL Useful Links" wiki several times and can see this being just as valuable. I know it represents SO many hours of your efforts and it is greatly appreciated!"
Jinchun Chen: "Awesome. All-In-One."
Richard Mueller: "A great collection of references."

Silver Award Winner

 

Ronen ArielyCrazy TSQL Queries play timeJinchun Chen: "Really good."
Samuel Lester: "As a long time software tester, this article brings me joy! :) Great job breaking the mold and adding content that gives the reader something they likely have never thought about. After reading this, I immediately started thinking of other areas where we could expand this. These are all outstanding learning exercises and would make for great interview questions as you mentioned. I still consider Pinal Dave's SQL Server Interview Q & A as the best around, but I could really see a section added where you tackle problems like these which require deeper knowledge to solve. "
Richard Mueller: "An interesting and educational collection of snippets."

Bronze Award Winner

 

Saeid HasaniAll-at-Once Operations in T-SQLRichard Mueller: "Very interesting and informative in an attractive article."
Samuel Lester: "Great article! Ask 10 C#/.NET coders this question and see how many get it correct. :) Very strong points in the Silent Death section regarding execution order based on the estimated execution plan. We see this problem trip up many people in the MSDN forum questions and could possibly be a blog/wiki article on its own. "


 

Guru Award Visual Basic Technical Guru - October 2013  

Gold Award Winner

 

Reed KimbleHow to Draw a Border of ASCII Text in a Console ApplicationRichard Mueller: "Very clever solution. I like this."
Ed Price: "Brilliant formatting, and great explanations, code blocks, and images!"
Mark Rideout: "I (heart) this for nostalgic reasons, plus a very good article!" 

Silver Award Winner

 

The ThinkerMultipoint with the Kinect part IMR: "Very cool to see! "
Richard Mueller: "I found the code difficult to follow. Code commented out didn't help."
Ed Price: "Good depth! I think it could be improved if the code was broken up into sections with more explanations, steps, and result images. This is a great topic!"

Bronze Award Winner

 

Reed KimbleHow to Write to a Console Window without Wrapping TextRichard Mueller: "Very interesting and informative."
Ed Price: "Important topic that's presented very well!"
MR: "Awesome article structure and educational!"


 

Guru Award Visual C# Technical Guru - October 2013  

Gold Award Winner

 

Jaliya UdagedaraFilter a DataTable based on a CollectionNN: "Very nice and simple solution and easy to understand."
CW: "This is a good example on how to use Linq in a creative way. This makes code that otherwise would be long and arduous elegant!"
Ed Price: "Excellent explanations!"

Silver Award Winner

 

Karl MitschkeClear System Center End Point Protection exclusions without SCCMEd Price: "Very thorough. Great Output section!"
NN: "Very useful program. May use some comments in the code"
CW: "This article does show something useful (messing with the registry through c#) but is titled in such a way I don't think I would think this article would be useful for that. Maybe more useful would be a more general article about this? That being said, this seems to address an issue in endpoint protection where it doesn't properly remove old things." 

Bronze Award Winner

 

Mohammad NizamuddinMicrosoft.NET: SMTP Server Relay setting and sending email using C# codeEd Price: "Good directions and easy to follow!"
CW: "This article accurately demonstrates how one might send an email from c#. This functionality could be useful for a number of applications I do believe the article could be improved by adding a summary/abstract for waht the articl contains. Just jumping straight into configureing an smtp server didn't do it for me."
NN: "Nice and simple article with clear instructions"


 

Guru Award Windows Phone and Store Apps Technical Guru - October 2013  

Gold Award Winner

 

mcosminHow to transfer files between a Windows Store app and any Windows Phone appPrashant Phadke: "Good example that shows the compatiblity. The initial topic regarding what is TCP is way too much and perhaps out of scope. Maybe a better approach would be to include links to the TCP RFC at the bottom. Including any additional links is also helpful"
Ed Price: "Fantastic explanations! Could benefit from section headers and a TOC."
RC: "Fantastic stuff! A great addition would be demonstrating the PeerFinder to make the connection without having to enter the hostname" 

Silver Award Winner

 

Thomas Claudius HuberUsing the RenderTargetBitmap in Windows Store Apps with XAML and C#Prashant Phadke: "Very nicely written."
Ed Price: "Great formatting, and the images help tell the story!"
RC: "Great explanation of one of my favourite new features in Windows 8.1!"

Bronze Award Winner

 

fabian.henzler.serwiz.netTestable navigation with MVVM through behaviors on Windows Phone 8Prashant Phadke: "Step 4 doesn't have DetailsPage.xaml and DetailsViewModel.cs screenshot. The displayed screenshot is for Step 2. The article ends abruptly, maybe add a closing line and add some helpful links if applicable."
Ed Price: "Clear instructions with complementing code snippets and screenshots. Could also benefit from section headers and a TOC."
RC: "If I wasn’t already familiar with behaviors I'd be completely lost. I'd like to see it call out and explain the behavior code up top before going into the general code listing."


 

Guru Award Windows Presentation Foundation (WPF) Technical Guru - October 2013  

Gold Award Winner

 

Magnus (MM8)WPF: Displaying and Editing Many-to-Many Relational Data in a DataGridEd Price: "Very well written and well formatted with a TOC, headers, an image, and code snippets. "
Peter Laker: "Love this piece of work from growing legend Magnus "

Silver Award Winner

 

Gaurav KhannaNested menuitem in WPF ToolBarPeter Laker: "Another heavy weight contributor, another sensational piece"
Ed Price: "Great formatting. Would benefit from breaking up the code more and more explanations. Great topic! "

Bronze Award Winner

 

XAML guyWPF: Watermarked TextBox and PasswordBoxEd Price: "Fantastic topic that's very clear. "
Peter Laker: "It's mine!" 


 

Guru Award Forefront Identity Manager Technical Guru - October 2013  

Gold Award Winner

 

Peter_StapfFIM 2010 R2: HowTo search for request details in msidmCompositeTypeEd Price: "Great formatting on the code, sections, and great images. "
PG: "Nice work!"

Silver Award Winner

 

Ike UgochukuFIM 2010 R2: WAAD Connector - Managing the SourceAnchor field in a Multi-Forest Exchange organizationEd Price: "Great detail and explanations!"
PG: "Nice article, but would like to see the procedure to be elaborated just a bit more. Some additional screen shots would be nice. And a very short tech description what is missing to solve the requirements."


 

Guru Award SQL Server Database Engine Technical Guru - October 2013  

Gold Award Winner

 

Uwe RickenDelete huge amount of data
from a relation
NN: "Very interesting article with great code"
Samuel Lester: "Incredible explanation and depth to a question we're seeing more and more often due to data size. Great comparison of different techniques along with why the standard "switch to simple mode" solution won't work in most cases where customers are hitting these bounds."
Ed Price: "Amazing formatting and detail!"
Jinchun Chen: "Good practice."
DRC: "Feedback: • This article is provides a very good information about the topic which is being discussed. • It also provided a sample code which can be tested on SQL instance with sample expected output. • This also talks about other alternate solution and scenarios to which this article is applicable. Suggestions: • Avoid line number in the sample code which needs to be edited in order to execute. • High light the key word which is discussed, also highlight the same in the code sample. Holding an "EXCLUSIVE LOCK (WITH TABLOCK)" on the target table can use all benefits of BULK LOGGED operations. INSERT INTO dbo.bigtable WITH (TABLOCK) (Id, c1, c2, c3) "

Silver Award Winner

 

Shanky_621What does 'Log Truncation'
counter value signifies in DMV sys.dm_os_performance
_counters
DRC: "--The article seem to be incomplete --Doesnt include all the points discussed --Don't use the short forms like : BOL MS Perfmon VLF's AFAIT -- Since the code is wrtten with reference to Adventure works database, include the location to download the adventureworks so that the users could downloadthis."
NN: "Good article but a bit hard to understand"
Samuel Lester: "Great investigative work on this and for digging so deep into it, I learned a lot from your write-up. I emailed a few folks on the Engine team to see if I can find someone who's worked directly on this code. "
Ed Price: "I love the "Suggested Reading" section!" 

 

Guru Award Windows Server Technical Guru - October 2013  

Gold Award Winner

 

Mr XRecord Logon / Logoff Activities on Domain Servers and Workstations Using Group PolicyGL: "Simple yet effective. It would be interesting to add additional parameters that can be recorded in the logon and logoff scripts"
Richard Mueller: "Details a simple but effective way to track network usage."
JM: "This is a great article, good work."
JH: "useful"

Silver Award Winner

 

Mr XManagement of SIDs in Active DirectoryRichard Mueller: "An excellent summary of important information in an attractive article."
GL: "Great topic. This would be very useful if it included a script to detect duplicate SIDs. The "import-module activedirectory" command listed does not work unless the module is installed."
JM: "This is a very good article, nice work."

Bronze Award Winner

 

Mr XCentral Management of DNS configuration compliance and updatesGL: "Interesting integration of SCCM compliance with a migration scenario, has several applications."
JH: "great article with good scripts to automate a time-consuming task of updating DNS settings"
JM: "This is an excellent article."
Richard Mueller: "Great to have scripts for this. Could add error logging."

As mentioned above, runners up and comments were removed from this post, to fit into the forum's 60,000 character limit.

 

A great big thank you to EVERYONE who contributed an article to last month's competition.

Hopefully we will see you ALL again in this month's listings?

 

As mentioned above, runners up and comments were removed from this post, to fit into the forum's 60,000 character limit.

You will find the complete post, comments and feedback on the main announcement post.

Please join the discussion, add a comment, or suggest future categories.

 

If you have not yet contributed an article for this month, and you think you can write a more useful, clever, or better produced wiki article than the winners above, here's your chance! :D

 

Best regards,
Pete Laker

 

More about the TechNet Guru Awards:


#PEJL

Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over to the one and onlyTechNet Wiki, for future generations to benefit from! You'll never get archived again!

If you are a member of any user groups, please make sure you list them in the Microsoft User Groups Portal. Microsoft are trying to help promote your groups, and collating them here is the first step.

SQL 2012 statistics issue

$
0
0

Hello,

I have a performance problem on my SQL 2012 SP1 enterprise edition database server. Basically we have a query that is reporting against a 600 million row table on which we have a clustered index and a non clustered covering index.The query runs extremly slow when it uses the non clustered index.The reason being the query incorectly assumes this index has only 1 row (estimated number of rows 1,actual number of rows around 2 million) while hash joining with a temp table and  hashes this index into memory which spills to tempdb. Even though I have updated the statistics with FULLSCAN multiple times and flushed the query cache, the query continues to assume the same. If I drop the non clustered index the query runs fast as it uses the clustered index which it correctly diagnose the row count. The nonclustered index/statistics is created on  int,Datetime column whereas the clustered index is on datetime,int columns. I cannot use query hint to force it to use clustered index for this query. Can someone suggest where might be the problem? Appreciate your help.

SELECT
Correlation.Domain as Domain,
ns.InterfaceID AS InterfaceID,
data.SourceIPSort AS IPSort, data.SourcePort AS Port, data.SourceAS as AsId,
data.*
FROM #Temptab ns
INNER JOIN Tab3 data  WITH (NOLOCK) ON ns.InterfaceID = InterfaceIDRx
INNER JOIN View1 AS Correlation ON Correlation.IPAddressSort = SourceIPSort
      WHERE  (1=1)
    AND ( StartTime >= '2013-11-15T00:00:00' AND StartTime < '2013-11-19T00:00:00' )AND(NodeID=998)

Sample of historam

Statistics for INDEX 'IX_NodeID_StartTime3'.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Name                            Updated                         Rows                            Rows Sampled                    Steps                           Density                         Average Key Length              String Index                   
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
IX_NodeID_StartTime3            Nov 23 2013  3:13PM             639376094                       639376094                       200                             5.374837E-06                    8                               NO                                                              639376094                      

All Density                     Average Length                  Columns                        
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0.004424779                     4                               NodeID                         
1.66179E-07                     8                               NodeID, StartTime              

Histogram Steps                
RANGE_HI_KEY                    RANGE_ROWS                      EQ_ROWS                         DISTINCT_RANGE_ROWS             AVG_RANGE_ROWS                 
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1                               0                               94346                           0                               1                              
2                               0                               58573                           0                               1                              
3                               0                               100618                          0                               1                              
5                               0                               2533304                         0                               1                              
35                              0                               8889027                         0                               1                              
36                              0                               4214197                         0                               1                              
38                              0                               1.137143E+07                    0                               1                              
39                              0                               1.297758E+07                    0                               1                              
47                              0                               877041                          0                               1                              
49                              0                               7284844                         0                               1                              
64                              0                               4544215                         0                               1                              
65                              0                               1421458                         0                               1                              

One sql server job("Runs DBCC UPDATEUSAGE(0) against all database so database size reporting is accurate") fails.Why is fails and how to fix it? I post error log.

$
0
0

Here is error message:

Date                     11/24/2013 4:00:02 AM

Log                        Job History (_SQL_UpdateUsageAll)

Step ID                2

Server                  DECSQL05

Job Name                           _SQL_UpdateUsageAll

Step Name                        Update All

Duration                             00:04:28

Sql Severity                       14

Sql Message ID                2528

Operator Emailed                           

Operator Net sent                          

Operator Paged                               

Retries Attempted                         0

Message

Executed as user: ****\SVCDECSQL05. ...[SQLSTATE 42000] (Error 942) DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Error 2528) DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Error 2528) DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Error 2528) DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Error 2528) DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Error 2528) DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Error 2528) DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Error 2528) DBCC execution completed. If DBCC printed error messages, contac... The step failed.


fill data from database in the combobox at run time

Getting error on ALT+F1

$
0
0

 I am getting below error when I am clicking on ALT+F1 to see that table structure. Even I select any of the table, getting same error message. 

Msg 208, Level 16, State 1, Procedure sp_help, Line 103

Invalid object name 'master.dbo.spt_values'.


Regards Vikas Pathak

Getting error on ALT+F1

$
0
0

 I am getting below error when I am clicking on ALT+F1 to see that table structure. Even I select any of the table, getting same error message. 

Msg 208, Level 16, State 1, Procedure sp_help, Line 103

Invalid object name 'master.dbo.spt_values'.


Regards Vikas Pathak

Upgrades and Migrations

$
0
0

hi,

what is the sql server "Up gradation & Migrations " and what are steps we can follow from lower version to higher version (2005 to 2012 or 2008 to 2012).

please give the clear picture of this "up gradation & migrations".

Thanks,  

Incorrect syntax near the keyword 'by'. Incorrect syntax near the keyword 'where'.conn = new SqlConnection("Data Source=PROJECTIDEAS\\SQLEXPRESS;Initial Catalog=Amruta_Ontology;Integrated Security=True"); conn.Open(); da = new SqlD

$
0
0
conn = new SqlConnection("Data Source=PROJECTIDEAS\\SQLEXPRESS;Initial Catalog=Amruta_Ontology;Integrated Security=True");
            conn.Open();
            da = new SqlDataAdapter();
            da.SelectCommand = new SqlCommand();
            da.SelectCommand.Connection = conn;
            da.SelectCommand.CommandText = "with cte as (select  Para_id,classname,COUNT(*) [cnt] from ClassClassificationgroup by Para_id,classname),cte2as(select Para_id,classname,ROW_NUMBER() over(partition by Para_id,classname order by cnt desc) rno from cte) update A set ClassName= B.classname from  ParaClassification A  inner join cte2 B where B.rno=1";
            da.SelectCommand.CommandType = CommandType.Text;
            da.SelectCommand.ExecuteNonQuery();

Viewing all 12963 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>