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

SQL server 2005 job execution failed

$
0
0

i am working with sql server 2005 db and it had a job scheduled for a routine process.

recently i detached the database and it has attached with another sql account. after that the job has failed to execute.
i changed the DB owner to previous account and still the same.

i am getting the below message,

Executed as user: UserName. An error occurred in the Microsoft .NET Framework while trying to load assembly id 65565. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error: System.IO.FileLoadException: Could not load file or assembly 'biz.spsolutions.dtsl.invoice.sicr, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of. The step failed.


Event ID: 28005 Error filling up Windows Application log

$
0
0

I am having the following error in a SQL 2008 Std 64bit installation running on Windows 2008 R2 Standard 64bit. I believe these errors may have started as the result of a SQL user account or database being deleted. I have not been able to find any information how to correct this issue.

Error in Windows Application Log:

Event ID: 28005
Source: MSSQLSERVER
Level: Error
User: N/A
Task Category: Server
Keywords: Classic

Details:
An exception occurred while enqueueing a message in the target queue. Error: 9728, State: 1.
Cannot find the security certificate because the lookup database principal ID (12) is not valid. The security principal may have been dropped after the conversation was created.

These error are coming in at a varying rate of anywhere between 1 to 100 errors per second and lasting for 30 seconds, then stopping for 30 seconds.

Any ideas?
Thanks
Larry

Question regarding snapshot isolation

$
0
0

We have SQL Server 2008 R2. We have implemented a logon trigger on this server so that only particular user/application combinations are allowed into the server, and all others are logged. This works perfectly fine.

Recently we have had a vendor trying to install an application that uses WCF. Their database has read_committed_snapshot on and allow_snapshot_isolation on. This is the only database on my server with these options. When their software tries to run, I get the following error message in my SQL log:

"Snapshot isolation transaction failed accessing database 'LogonLog' because snapshot isolation is not allowed in this database. Use ALTER DATABASE to allow snapshot isolation."

I'm not sure why their code is causing my logon trigger to fail, but I am guessing that they use transactions and the trigger is getting thrown into the snapshot isolation. I am wondering if I set these two options on my trigger database if I could be causing any performance issues, or cause other applications to fail? I really don't want to change this trigger DB for one application, especially if it could cause me bigger issues, but I am looking to see if anyone has any thoughts on it. Thanks.

Question about "Client Statistics"

$
0
0

Hi, 

SQL Server 2008R2. 

Are the "Trial #" columns in this tab database independent, i.e. are they instance statistics?  

I'm running the same query against two databases, the first is a UAT and the other is production.  The first
column ("Trial 1") seems to be from the first execution,  and "Trial 2" the second execution.  

Some tables in the UAT have been tuned so I would expect the "Trial 1" column to be better 
(accepting that  there are less rows in UAT)

What do people make of these results?   The time Statistics look better against the 
tuned database which is what I expected but the packets etc are not so different. 



Auto Update Statistics not updating the stats

$
0
0

I am trying to learn how statistics are updated and I am kind of surprised why i am seeing a strange behavior. below is the scenario:

Database has auto update staistics and create statistics enabled. DB is SQL 2012.

Create Table tblcheck(sno int identity(1,1),sname varchar(10)) --Step 1 Insert into tblcheck(sname) Values ('Microsoft') Go 5000 --Step 2 Select * from tblcheck where sname='Microsoft' Select * from sys.dm_db_stats_properties(object_ID('tblcheck'),2) --Stats are updated here. --Step 3 Update tblcheck set sname='MS' --Step 4 Select * from tblcheck where sname='Microsoft' Select * from sys.dm_db_stats_properties(object_ID('tblcheck'),2) ---status are not updated, modification counter still shows the value.

--Step 5 If I run Select * from tblcheck where sname='MS' --it will update the statistics as the new query plan is generated.

In step 4, it is reusing the query plan generated in step 2 and hence not updating the statistics.

But, in theory, the statistics in step 4 should be invalid as the data change was 100%. So, statistics must be updated and hence a new query plan must be generated. but this is not happening. not sure why??

So, Question is why are the statistics not updated after step 4 query. Thank you in advance for helping me understanding.


Hope it Helps!!


The following error has occurred: Updating permission setting for file 'F:\System Volume Information\IndexerVolumeGuid' failed. The file permission setting were supposed to be..

SQL Server Not working

$
0
0

Dear team,

we have purchased a license copy of sql server 2012 and windows server 2012 in the year 2013 to use the system for our database of our hotel management software.

since the installation the sql has stopped working twice in the past 01 year.

we have tried calling your call centres but there is no help or support for an original software user.

kindly suggest how to resolve this problem.

Regards

Nishit

+919829793113 

1 Khmer language data Import

$
0
0

1)After  importing the Khmer language data,  it is displaying  as “????” in the application and Data Base.

2)And how it can import Khmer language .with out by prefixing “N”,

3)whether Microsoft SQL Server support  Khmer Language support. if support then how it support Explain.



referencing entities (e.g. where is my table used)

$
0
0

Hi,

firstly if this is in the wrong sub-forum sorry and if someone could move it that would be fantastic...

Issue

I need to change numereous tables in a number of databases so I obviously need to be sure that I ammend all dependant objects.

I have used sys.dm_sql_referencing_entities and that works fine when, for example, the view is in that same database as the table - when it is not I have a problem.

So

USE [database-a]

SELECT referencing_schema_name, referencing_entity_name, referencing_id, referencing_class_desc, is_caller_dependent
FROM sys.dm_sql_referencing_entities ('myscheme.mytable', 'OBJECT');
GO

Returns all the objects referencing mytable in database-a but I am stuck when for example the view is in database-b

USE [database-b]

SELECT referencing_schema_name, referencing_entity_name, referencing_id, referencing_class_desc, is_caller_dependent
FROM sys.dm_sql_referencing_entities ('myscheme.mytable', 'OBJECT');
GO

does not find the view, however

SELECT OBJECT_SCHEMA_NAME(object_id), OBJECT_NAME(object_id) FROM sys.sql_modules WHERE [definition] LIKE '%mytable%'

does.

Question

1. Is there an easy way of finding all the stored procedures and views that reference my tables regardless of the database the view or stored procedure resides?

I can knock up a script that switches database and runs the select from sys.sql_modules for every database but that seems clumsy at best.

2. I have not looked into this yet so sorry if it is obvious - but I also need to know which SSIS packages reference the tables I am about to change...

Before you ask

I did not create these views / stored procedures / SSIS packages and documentation is lacking (read missing).

I will not be creating any views in different databases from the table they reference - excluding cross database views where this is justified.

Thanks in advance.

Shaun

This backup cannot be restored using WITH STANDBY because a database upgrade is needed

$
0
0

Version Server

Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (Intel X86)   Jun 17 2011 00:57:23   Copyright (c) Microsoft Corporation Enterprise Edition on Windows NT 5.2 <X86> (Build 3790: Service Pack 2) 

1. I made a base backup together with ravines (to make Log Shiping).

2 . I started developing a base backup, it started becoming showed percent 
     10-20 percent, everything was as though good.
3 at the end I issued such message

System.Data.SqlClient.SqlError: 
This backup cannot be restored using WITH STANDBY because a database upgrade is needed. Reissue the RESTORE without WITH STANDBY. 
(Microsoft.SqlServer.Smo)

The base was restored only in a restoration mode. The mode only isn't present reading.

How to set restoration parameters that the base was in the Read/Only mode

Extended events /actions definitions

$
0
0

One of the shortcomings I seem to keep stumbling across is that event action definitions are no where to be found.  I've been searching for weeks and can't find a resource from Microsoft which helps me understand the official definition for an action.  

Has someone here found that resource or know where it is?

Retrieving Active Directory infomation from SQL Server

$
0
0

Dear All

We have a requirement to load active directory users and user groups into a SQL Server database. Looking at the information available it seems you need to create a Linked Server of type 'Active Directory Service Interfaces'. Creating a linked server will be a problem for out customers so I was wondering if there was another way of doing it. I will accept all ideas no matter how odd :D

Thanks

Peter

Can't restore SQL 2005 BAK to SQL 2008 R2 running on Server 2012

$
0
0

Hi there,

Preparing to switch from SQL 2005/Server 2003 to SQL 2008 R2 / Server 2012.   Took a backup of the SQL database on 2005 (stored at a cloud backup provider nightly) and copied to the new machine.  Unable to restore the .BAK file, with the error:

The media family on device <backup path> is incorrectly formed.  SQL Server cannot process this media family.

RESTORE HEADERONLY is terminating abnormally.  (Microsoft SQL Server, Error: 3241)

Tried it with two different backup files from two different nights, same error.  I understand that this error can show up when restoring to a lower version of SQL, but that's not the case here.

Also, I know this can occur if the BAK file is corrupt, and I can't verify that yet, but two in a row failed.  I'm hoping our cloud solution isn't part of the problem somehow.  

BAK file is 15 Gb in size, so don't have the ability to attempt the restore on the 2005 production server.   Just not enough room, and can't afford to cause performance issues on that box anyway.

Anyone know of any way to get a better handle on what's going on, or, even better, how to resolve it?

Thanks

Robin

SQL performance issue

$
0
0

We are hitting performance issue multiple times, pls find the details and sql logs and can you give some suggestions. 

  • SQL broker started lock time out error at 1:20 AM.
  • Failed to allocate page at 03:25 AM.
  • Insufficient memory occurred at 3:25 am on wards(log attached).
  • SQL shutdown at around 3:40 am.

SQL Log Links

https://www.dropbox.com/s/ruo9ye2u711b9o9/sql%20Log.log?dl=0

https://www.dropbox.com/s/a8bvtna1swtt8fo/sql%20Log_Full.log?dl=0'


Naveen| Press Yes if the post is useful.

cannot find date

$
0
0

select  col from table where col between a and b

col = dd/mm/yyyy(nvarchar)

a   = yyyy/mm/dd(datetime)

b   = yyyy/mm/dd(datetime)

plz help me solve complected query


Sms



What is done with pssdiag output

$
0
0

Whenever our team is not able to solve the issue (mostly slowness )we contact to Microsoft and they ask us for PSSDIAG output.

After that what they do?

I know SQLNexus is there but is SQL Nexus smart enough to drill down the issue?


Thanks

help to resolve error in sending database email from SQL Server 2012.

$
0
0

Please help to resolve error in sending email from SQL Server 2012.

SQL Instance Version:

Microsoft SQL Server 2012 (SP1) - 11.0.3449.0 (X64) 
Jun 29 2014 23:15:18 
Copyright (c) Microsoft Corporation
Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3 <X64> (Build 9600: )

Error Message: Error MeThe mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2015-01-15T19:48:25). Exception Message: Cannot send mails to mail server. (The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.1 Client was not authenticated).)



A Lock Compatible Event is confused

$
0
0

I give out the demo as following

Create a test table and insert some test data

 CREATE TABLE dbo.DemoX
     (
       [key] INT PRIMARY KEY ,
       [value] INT,
     );
 GO
 INSERT  INTO dbo.DemoX
         ( [key], value )
 VALUES  ( 1, 100 );
 GO

Select query against the test table and then observe locks that  the query requests

BEGIN TRAN
SELECT  [key],value
FROM    dbo.DemoX D WITH (XLOCK);

SELECT  L.resource_type,
     L.request_mode,
     L.request_status,
     L.resource_description,
     L.resource_associated_entity_id
FROM    sys.dm_tran_current_transaction T
JOIN    sys.dm_tran_locks L
     ON  L.request_owner_id = T.transaction_id;


It seems normal.

Then,I open another new query session and execute below query

SELECT  *
FROM    dbo.DemoX;

SQL Server gave us a surprise result.Rows can still be read!

Why didn't the first query block the second query?

Is it a bug or not?

There is another thread talk about this problem

http://stackoverflow.com/questions/4609217/sql-server-the-misleading-xlock-optimizations


Love SQL

SUSPENDED status issue

$
0
0

Hi all, we have queries submited via IBM Cognos to MS SQL 2008 and we get a lot of SUSPENDED processes. The problem

  1. The SUSPENDED process does not close down by itself even when the request no longer exists in IBM Cognos and the only way to get rid of it is by killing it.

Any ideas on how we can rectify this issue?

Master database logical file names are different - Please Help!

$
0
0

Today I noticed that one of the server in our environment,

when i run 

SELECT * 
FROM sys.database_files

i got results 

data_space_idname
1master2
0master_Log2

Please note logical name of the master database files.

But, in SSMS if i right click and choose properties for master database, it shows logical file names are master, mastlog.

How can this be happened? How can i fix this issue and make it both same names for master database?

Please help!

Viewing all 15264 articles
Browse latest View live