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

Problem: INSERT/UPDATE/DELETE failed because the following SET options have incorrect settings: ‘QUOTED_IDENTIFIER’

$
0
0

I have this rather awkward problem:

For two weeks now, whenever after I've updated/created stored procedures using my SQL scripts, when these SPs are run, they fail with above error.

Other posts dealing with this problem didn't help in my case.

Here's a number of parameters, helping to exclude common solutions which do not apply in my case:

  1. My Stored Procedure scripts work flawlessly on my laptop (SQL Server 2012, Windows Server 2008 R2).
  2. My Stored Procedure scripts correctly create SPs on any other machine (which is our build machine, having SQL Server 2012 installed; our TEST server, having SQL Server 2005 installed, and our PROD server, having SQL Server 2005 installed). However, the SPs won't run on any other machine than mine.
  3. I'm using a database backup of our production SQL Server (SQL Server 2005) on my machine (like any other machine here does).
  4. Even the most basic SP fails (e. g. "DELETE myTable WHERE ID = @delID").
  5. On every SQL Server installation I've checked, Quoted Identifier is set to OFF (!), both on server and on database level. So why all of a sudden are my SPs required to have this option set toON?
  6. I'm using SQLCMD to run my scripts. This gives me an option to dynamically set the server instance's database name in the USE statement.
  7. My scripts only contain a USE statement and right after the ALTER PROCEDURE; or alternatively IF EXISTS (...) DROP PROCEDURE ... GO; CREATE PROCEDURE ...


This all worked for years now, but suddenly, since two weeks ago, SPs created with my scripts suddenly fail.

I know that I could manually set QUOTED_IDENTIFIER to ON in my scripts - but I don't want to. There is something wrong here. I want to know what that problem is.

What's happening here?


Microsoft Marketing should care for customer feedback on their consumer products, e.g.Windows& Office.


Have had Windows 8 …  went back to Windows 7.


Backup Sql Server maintenance plan

$
0
0
I have a full backup of the database is done every day with compression. Because of this small size of the backup files, and how much recovery risk , if I will restore backups? or me take a full backup without compressing a week? Which option is better? thank you

Understanding Scale in perfmon charts

$
0
0

Hello,

I have collected the perfmon data and I can read it when it is in excel spreadsheets. I want to create charts over this data but when I see the scale, I don't understand what range of data is getting displayed. Can someone help me in understanding the scale setting?

Regards.

When will the DAC port change on a clustered named instance?

$
0
0

I have a clustered named instance on SQL Server 2014. I have enabled the DAC Port for emergencies. I want to record this DAC port in our inventory system so that DBAs can connect to it if the SQL Server is behind a firewall. In that instance we will open the firewall to the DAC port. I am a bit nervous about the DAC port changing for some reason. If I set the DAC port in the registry, will it ever change? Is there any way to know that the DAC Port has been manually set?

If the SQL Server is not behind a firewall then we can just connect using -A or Admin: and not worry about it.

Cumulative update patch 9 for SQL 2012 SP1 doesn't update SQL version number from 11.0.3000 to 11.0.3412

$
0
0

I have applied CUP9 to the SQL2012 SP1 server. Update went through successfully and I restarted the server. However, SQL version didn't change to 11.0.3412 as expected, but still shows 11.0.3000.

It shows HOtFix 3412 for SQL Server 2012 (64-bit) installed in Installed Updates in Programs installed on the server.

Did anybody else experienced this or has any insight on this? How can I be sure that CUP9 is actually installed?

I appreciate any response!

Deadlock waitsource page db_id:1:some number

$
0
0

Does that mean the contention is on the PFS page?

Any guidance here?

There is more than one data file but I guess that wouldn't make a difference once if it's the same object will be on the same data file?

Thanks!


Paula

profiler execution plan ONLY for long running queries

$
0
0

The duration only applies to specific profiler events however I'd like to capture the execution plan ONLY for queries over 10 minutes.

Is there a way to do this using Xevents?

Anyone knows?

Thanks!


Paula

The log scan number passed to log scan in database 'master' is not valid.

$
0
0

I get the error below when the SQL server tries to start. They have backups of the SQL server files but not BAK files just Symantec files backups of the SQL Server folder. I’ve tried replacing the master.mdf and mastlog.ldf files from the backups but I still get the same error with different log scan numbers. Also tried replacing the model files and that just created errors.

Looking around online it gets very confusing as some say it’s the master database or
the model or that the user and password has changed. Some say to copy the master
database files from the template folder but there is none on this system.<o:p></o:p>


Any ideas? Thanks.

The log scan number (137:128:37) passed to log scan in database 'master' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.




SQL Local Database not working properly (Visual studio 2012-ultimate edition)

$
0
0

Hi, 

I tried to create a local database in Visual studio 2012. Everything works fine;however, when I try to create a windows form application (c#) and tried to add/edit/delete data I cannot do it. I keep on getting this message "unhandled exception" when i try to run the form. I searched online and there seem to be no answers so I was wondering if anyone can help me with this process. This is the video that i followed : http://www.youtube.com/watch?v=1EpYqtSlOr8.  Thanks a lot. 


Max_server_memory affecting plan.

$
0
0

Hello,

I am experimenting on TPCH 10-GB data, and I came across following :

Keeping Max_server_memory=128MB, the plan chosen by the optimizer involves Nested loop join.

Keeping Max_server_memory=4096MB, the plan chosen by the optimizer involves Hash Match join.

Can, you explain me how changing max_server_memory is affecting the choice of plan, one more thing to specify is that, I am talking about estimated execution plan only, i.e. these mention plans are estimated plans and not actual plan.

Looking forward to some helpful explanation!

Lock granularity

$
0
0

Hi,

I have a situation where I don't understand why one stored procedure is blocking another. The procedure issues an UPDATE according to this pattern:

UPDATE [T] SET Col1 = Col1 + 1 WHERE Col2_FK = @id

Col1 here is a regular attribute and Col2_FK is a foreign key. Thanks to a mismatch between data model and application model this update will always affect exactly one row. (Col2_FK has a constraint and is NOT NULL and I've furthermore done a count(*) grouped by Col2_FK having count(*) > 1 to verify there are no two rows in T with the same value in Col2_FK.)

If I open up two tabs in management studio, start a transaction in each, and then run the procedure first in tab #1 and then #2 withdifferent @id, the second session is always blocked by the first (until I commit or rollback).

I would expect an X lock at row level only, with IX on the page and table. But then the two transactions would run concurrently, since they do not in fact share any data. In other words, I would expect #1 to block #2 only when the value of @id is the same in both transactions.

Table T has a clustered index (of type int identity(1,1)), and so does the table referenced by the FK. There's no index for the FK itself.

I have tried to use SQL Profiler to understand what's going on, but the trace contains only mysterious IDs (that look suspiciously like addresses - it seems to always be valid hex values) and I don't understand if the locks are row locks or page locks.

If the update is done based on PK instead of FK, it appears only row locks are held and both transactions can run concurrently. 

There's so little data in the table it's probably all on the same page (data space used, as viewed in object explorer details in management studio, is 8KB = 1 page). I therefore suspect an X lock exists at the page level, but I don't understand WHY the database engine would go ahead and lock in practice the entire table just because I update a single row in it (out of ~100 small rows).


Shrinking transaction Log file

$
0
0

Hi All,

Here is my scenario,

I have a SQL  2005 and 2008 instance, where disk space is very minimal. Transaction log file in some Dbs eats up the disk space at times. So i have to login and shrink the log file to release the disk space( eventhough shrinking is not a good pratice, but no other way).

Is ther a way i could automate this. Say, if the log for a DB filled up the disk, an event should trigger a job, which has SP that contains dbcc shrinkfile and the database concerned is queried from sys.databases and sys.master_files based on reuse_desc dynamically. The job runs and releases the disk space.

Provide me your valuable recommendations on how to accomplish this task.

Thanks


Automate data refresh from prod to dev

$
0
0

Is there any way I can auto update my development database from prod nightly? 

Please Provide me info step by step and script also.. Thanks

Start SQL services after IP change

$
0
0

Hello

We have two SQL instances in the same computer: default (MSDE) and named instances (SQL 2008).

We changed the IP address a few days ago, and suddenly we cannot start the SQL services in either instance.

I think in the past when I did a select @@servername, the result was

- for the default instance, it was the IP

- for the name instance, it was the IP\instance_name

Is there a work around other than changing it back to the original IP or re-installing SQL server?

Thanks

Carbond.

Log shipping

$
0
0

there are about 12 logshipping database in my server.  need to change  database and log file to different location in my secondary server.

what is best way todo

thanks

v


Linked Server Error

$
0
0

EXEC sp_addlinkedserver
    @server = 'ExcelServer2',
    @srvproduct = 'Excel', 
    @provider = 'Microsoft.ACE.OLEDB.12.0',
    @datasrc = 'E:\Emp_database.xlsx',
    @provstr = 'Excel 12.0; IMEX=1; HDR=YES';


After creating a linked server i executed below query :

    SELECT * FROM OPENQUERY
    (ExcelServer2, 'SELECT * FROM [Sheet1$]')

Error Message :

OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "ExcelServer2" returned message "Unspecified error".

Msg 7303, Level 16, State 1, Line 1

Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "ExcelServer2".


        Please help me on this very emergency.

Thanks in Advance....

       

Question on SQL Server Advanced Configuration

$
0
0

Query wait option under Parallelism in SQL Server advanced configuration if set to 0 does it mean infinite? I know the maximum limit that can be specified for this option is 2147483647 but just wondering if it can be set as infinite.

Thanks for your help!

How to update the identity_column value in sql server 2008

$
0
0

Hi Team,

I have identity column based table. In the table i use insert the name as per the requirement and for ID i use to set the identity now i need to update the particular row id.

when i use to trying i'm getting the below error.

Msg 8102, Level 16, State 1, Line 4
Cannot update identity column 'CategoryID'.

Kindly help me out regarding this.

Thanks & Regards,

Ramesh R

MEMORYCLERK_SQLOPTIMIZER (node n > 0) missing from DBCC MEMORYSTATUS

$
0
0

Last week during an event just like this one:  http://social.msdn.microsoft.com/Forums/en-US/1ecf3d5a-31e3-4346-9ff7-93b1ff57a3cb/blockedprocessreport-what-is-this-waitresource-object-327671246076970-compile?forum=sqldatabaseengine and again here:  http://dba.stackexchange.com/questions/55120/excessive-compile-blocking-on-sp-procedure-params-90-rowset

I noticed that the output of DBCC MEMORYSTATUS only included a section for:

MEMORYCLERK_SQLOPTIMIZER (node 0)        KB

After i had cleared the 'COMPILE blocking' i ran dbcc MEMORYSTATUS again hoping something would show a significant before and after difference.  The only difference was that the after MEMORYSTATUS execution included sections for:

MEMORYCLERK_SQLOPTIMIZER (node 1)        KB

MEMORYCLERK_SQLOPTIMIZER (node 2)        KB

MEMORYCLERK_SQLOPTIMIZER (node 3)        KB

MEMORYCLERK_SQLOPTIMIZER (Total)         KB

Does this indicate anything?  Is it possibly connected to the state of the instance when blocking was happening?

SQL2008r2 Sp2 Cu 8 Standard on Win2008R2


-- dan http://dnhlmssql.blogspot.com/



Filetable Query Performance

$
0
0

Hi,

I have a small web app that basically provides a Search Engine-like keyword entry to search approx. 50k documents stored in directories, which I access through a Filetable Query on SQL server 2012.

I get great performance on this - typically less than half a second. Except for the first query of the day - it takes over 30 seconds. Then same or different keywords will be back under half a second.

What could SQL Server be initializing? Does anyone else see this kind of behaviour?

I added a schedule to populate the Full-text catalog at 06:00 every day but that made no difference.

Any help appreciated.

Viewing all 15872 articles
Browse latest View live


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