Quantcast
Channel: Forum SQL Server Database Engine
Viewing all 15889 articles
Browse latest View live

estimated execution plan vs actual execution plan

$
0
0
estimated execution plan vs actual execution plan

1.
What is the difference between estimated execution plan vs actual execution plan?

2.
What is the benefit of using estimated execution plan and actual execution plan?

3.
What context should you use estimated execution plan and actual execution plan?

I'm a beginner in performance tuning.

SQL Query fails with Fetch error

$
0
0

We are running JDE ERP 9.0 and have a report that gets this error

“JDB3300020 - Fetch not allowed. Prior successful Select operation required for this request.”

I’ve been troubleshooting this problem for months, and I am no closer to the root cause and need some help. I’ve engaged Microsoft support, we collected a trace but could not find anything that pointed to the cause.

Execution details:

Report runs successfully after database server is rebooted. Otherwise we have to keep rerunning as many as 15 times to get a successful run. When we discovered that report would run after the server reboot, we decided to only restart SQL, to see if it was Query plan related but it still failed. How can we determine why the reboot is making a difference?

Any ideas/help is welcome.

physical Connection Is Killed, Session Is Killed in extended events logs

$
0
0

hi all 

we are experiencing app timeouts and i am seeing nothing on db logs when i dig into extended events system health session i am seeing below info at same time 

connectivity_ring_buffer_recorded

tds_flagsPhysicalConnectionIsKilled, SessionIsKilled

sourceTDS

typeConnClose

can anyone help on this please 

Problem in connecting to database engine

$
0
0

I have installed sql server 2008 R2 on my system. And it was running fine. Then I have installed MS Dynamics NAV 2013 on my system. Now i am not able to connect to my instance of SQL Server.

I have checked all services of sql server and all services are in running mode.

Please Help.

Which of these three sql code with same result does have the best optimal performance?

$
0
0

Problem statement:
Which of these three sql code with same result does have the best optimal performance?

If you run three source code at the same time and each source code has a batch with different percentage value and how much percentage of clustered index or nonclustered index.

Which one does have the best performance and why?

I'm a beginner in performance tuning.

Versioning Tool for SQL Server?

$
0
0
Problem:
Does Microsoft have a versioning tool for SQL server?

I'm thinking about similiar tool as visual studio team foundation but for SQL server?

WOuld like to see any changes in a stored procedure in different version.

Restore backed up (.BAK file) from different server

$
0
0

Good Day,

I have backed up database (.BAK file) in the production, the file is on the Prod box, I would like to restore the .BAK file in to Dev from Prod, is it possible to de that, because we don't have enough space on the Dev box to move .BAK file from Prod to Dev.

Please provide me suitable solution.

Many thanks in advance.

Kind Regards

SQL Logs Size Increasing automatically

$
0
0

Hi,

I am facing a very strange issue in my SQL Server 2008 R2 Logs folder.

Actually in every 10 seconds SQLDump0000,SQLDump0001,.....     and so on named files are being created automatically in the Logs folder where SQL stores it's logs.I don't know why is this happening.

Due to this issue logs folder size is increased to 160GB and  my c drive where windows is installed is keep showing Low space message in fact 0MB space is showing.

Please help urgently.



Drop all the Primary keys in the database

$
0
0

Hello,

I do have a database called "TestDB" (for instance), in that database there are 10 tables, I would like to drop/delete all the primary keys from all the tables using script, because we would like do that very often or please suggest me which is the best to do that, in our environment we have more than 50 tables, we cannot go to each and every table and drop them.

Please provide suitable solution.

Thanks in advance.

Kind Regards

About Logical Reads

$
0
0

Problem:

1.
If you run a SQL code and you read the logical reads. is it benefit for performance issue to have low value of logical reads not matter what?

2.
What is the definition of logical reads?'

Im a beginner in performance tuning

SQL Server 2008 R2 { An Error occured when attaching database(s) }

$
0
0

Hello Guys!

I just installed SQL Server 2008 R2 a couple of days ago, on the first day use i can attach database(.mdf) with out any problem.

on the day 2, i keep getting this error:

http://img515.imageshack.us/img515/14/1212i.png

 

TITLE: Microsoft SQL Server Management Studio
------------------------------

An error occurred when attaching the database(s).  Click the hyperlink in the Message column for details.

------------------------------
BUTTONS:

OK
------------------------------

after clicking the Hyperlink this window open:

http://img34.imageshack.us/img34/8766/hyperg.png

TITLE: Microsoft SQL Server Management Studio
------------------------------

Attach database failed for Server 'STARGAZER-PC\SQLSTARMAX'.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Unable to open the physical file "E:\New folder\DataBase.MDF". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------

 

in that day i reinstall SQL Server 2008 R2, because I'm so confused. after that i try to attach i still got the same error, what i did is i share the folder where the database is.

i open SSMS and try to attach and i attached without any error...

i think this is the 4rth day, untill now everytime i want to attach a database i got this error, and even i try to share the folder where the database is i still got that error.

 

any advice guys?

 

Thanks a lot

 

 

jhules


if you want to be happy, find something you love to do and do it for free, then find someone to to you for it.

Issue with Merge command not finishing

$
0
0

SQL Server Standard 2008 R2

I have a rather complex MERGE command with when matched, not matched target, and not matched source.  It runs just fine on a data set of 360K rows, but does not complete on a 500K data set.  sp_who2 indicates millions of pagelatch_sh waits.  Yet if on that same data set, I break the Merge up and run each part individually (insert, update, delete) they each run very quickly.

Has anyone seen this before?

Transaction log usage grows due to replication even if I don't use replication at all

$
0
0

Hi

The transaction log usage keeps growing a lot on my user database since few days back. the database is in full recovery model and I do transaction log backups every 10 minutes. The DB was part of Database Mirroring but I removed it. The usage was controlled for many years by the backups but something happened that is messing up the transaction log

this is DBCC OPENTRAN

Transaction information for database 'MyDB'.

Replicated Transaction Information:
        Oldest distributed LSN     : (0:0:0)
        Oldest non-distributed LSN : (1450911:6823:1)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

log_reuse_wait_desc reports REPLICATION

the funny thing is that I am not using replication at all. I am using CDC.

To reduce the transaction log usage I run below statement every day since the problem started

EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, 
    @numtrans = 0, @time = 0, @reset = 1

Any idea what should I do to solve this problem and be back on a normal situation?

BTW, The server is SQL 2012 (11.0.2383)

Thanks


Javier Villegas | @javier_villhttp://sql-javier-villegas.blogspot.com/

Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you

An error occurred while executing batch. Error message is: The directory name is invalid.

$
0
0

SQL Server Management Studio 2008

Microsoft SQL Server 2008 (SP3) - 10.0.5512.0 (Intel X86)

Aug 22 2012 15:16:00

Copyright (c) 1988-2008 Microsoft Corporation

Enterprise Edition on Windows NT 6.0 <X86> (Build 6002: Service Pack 2) (VM)

When signed into the server using an account other than the local administrator on the machine I try doing a query with the results going to the grid.  I receive the error

An error occurred while executing batch. Error message is: The directory name is invalid.

I have tried uninstalling and reinstalling the client tools with no luck in fixing the issue.  I have also tried changing the directory to the directory of the local machine that I know exists and the user has access to.  This has not solved the issue either.

The server is a Windows Server 2008 Enterprise Edition with a 32-bit operating system.

Any help would be greatly appreciated.

Let me know if you have any questions.

Thanks

sys.foreign_keys is_not_trusted problem

$
0
0

Hello Forum,

I ran into difficult to explain situation with sys.foreign_keys.is_not_trusted value for 1 table.

3 times with not correct for this case statement: 'alter table drop constraint

then 'alter table create constraint and alter table check constraint'. To re-check this constraint, 2 'check' words required, scripts used wrongly just 1.

After 5 weeks, 3rd db was loaded with consolidated script at 1 time. Everything what was released to first 2 db's over the interval of 1 months was ran against 3rd db.

After sql comparison, 1st and 2nd db were identical and had constraint value sys.foreign_keys.is_not_trusted = 1 which was expected.

3rd db had sys.foreign_keys.is_not_trusted = 0.

Starting data for all 3 db's were the same and copied from prod. server.

Can anybody explain why 3rd had desired but not expected value 0? Does the value of foreign_keys.is_not_trusted have something to do with the interval of time?

if somebody from Microsoft have any insight explaining this unexpected behavior, it would be great.

Thank you for your time reading it.


gene


SQL services use 100% Harddisk when queries

$
0
0
I developed  my own app to query the data from MSSQL

I use MSSQL 2008 R2

when I run the query in MSSMS, it's work fine and has very fast response

but when I run with C# application (integrated query inside).

it take about 5000ms for 1 query and when I exterminate the task manager, I found that the services of my database engine using disk load about 5-7 MB/s (but the % is 100%)  

after some experiment. I found out that if I want to make the query faster in my C# app, I have to open the MSSMS "together" (and make any select top 1000) with my query in C# app

anyone know what is MSSMS do to increase the performance of any running services?


**Note that it happens only some PC not all of them. 

data base

$
0
0
How To connect database on visual studio 2013

Error Code-7886

$
0
0

Hi 

we are getting below error code in SQL Server

Error Code:7886

Error Message:A read operation on a large object failed while sending data to the client. A common cause for this is if the application is running in READ UNCOMMITTED isolation level. This connection will be terminated.

Please Advice On this.

Thanks & Regards

Surendhar.j

To get the last stop & start time of All SQL Server services(SSRS, SSIS, SSAS, etc.).

$
0
0
To get the last stop & start time of All SQL Server services(SSRS, SSIS, SSAS, etc.). 

PGupta

NOT IN vs. Except

$
0
0

I have following two queries:

select Artikelnummer from KHKArtikel WHERE Artikelnummer NOT IN (SELECT Artikelnummer FROM KHKPpsFaBelege)

select Artikelnummer from KHKArtikel
except
select Artikelnummer from KHKPpsFaBelege

Both should list all values Artikelnummer in one table not ocuuring in the other.
On our production machine the first query returns nothing while the second works well.

I ave two test machines where both queries work as expected. One of them is an Enterprise Edition the other Express Edition.
The production system is Standard edtion. All are SQL Server 2008 R2.

Does anyone have an idea, wher the difference comes from?

Viewing all 15889 articles
Browse latest View live


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