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

SQL error 5171

$
0
0
I'm getting an error while operating the SQL server. It displays as SQL server error 5171. I'm not able to resolve this error. Please, somebody, help me get out of this.

High consumed 99% CPU on SQL server

$
0
0

Hi I have been notice that SQL Server 99% touching . Checked  dead lock.  some of SQLs consumed CPUS but  ave cpu ms is very law . (reports->Standred reports->top sql total cpu time). Check with activity monitor , jobs are suspending - runnable. nothing much. I need to understand why this behaviour .

Version SQL Server 2014 SE

update bulk sql 2016

$
0
0

below statement going to update bulk, (taking 3hrs ),

this update  creates bloking for other process , how toaccomplish with out blocking other process?


update pd set url = 
u.url
from product_details pd
join inserted i on i.id = pd.pid
join v_product_details_url u on u.id = pd.id
join @changes c on c.id = i.id

How to Restore only Selected Tables from Backup

$
0
0

How to Restore only Selected Tables from Backup please?

Want to avoid third party tools.


Raghavendra Narayana

Deleted records from table

$
0
0

how to find deleted records from a table.

Req:  TableA & TableB

find deleted records from TableA  (some one deleted records from tableA dayago /  now same records needs to delete in TableB) 

Event 10016

$
0
0

On a Windows 2008 R2 server running SQL Server 2012, I started getting these recently:

SQL Server Scheduled Job 'Intraday Backup 1500.Subplan_1' (0x65C01B2C6FA5124493CA18E3665B09AA) - Status: Failed - Invoked on: 2012-09-10 16:18:58 - Message: The job failed.  Unable to determine if the owner (<DOMAIN>\administrator) of job Intraday Backup 1500.Subplan_1 has server access (reason: Could not obtain information about Windows NT group/user '<DOMAIN>\administrator', error code 0x6e. [SQLSTATE 42000] (Error 15404)).

After some research it seemed that I should change the owner of the job to something else, so I made it SQLServerAgent, that seemed to be the only thing that worked.

Now I'm getting these:

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID 
{FDC3723D-1588-4BA3-92D4-42C430735D7D}
 and APPID 
{83B33982-693D-4824-B42E-7196AE61BB05}
 to the user NT SERVICE\SQLSERVERAGENT SID (S-1-5-80-355555556-2666666661-2777777773-2888888883-1999999990) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool.

I did my usual digging around and couldn't find much that was useful, apart from notes about locating the appid mentioned in the registry and going to Component Services to fix the permissions.  The appid translates to MS DTS Server, nothing like that is listed in DCOM.



I've done a fair bit of searching and reading and got nowhere with this, maybe I'm missing the point.  The job does run now, I'm just averse to errors in the Event Log, I mean they wouldn't be there if it didn't matter, would they?


Hotfix for CU13 SQL Server 2017

$
0
0

I can't seem to find what I am looking for in regard to documentation on this, but can anyone answer if CU13 for SQL 2017 needs to be applied before the Hotfix for CU13 in order to get all of the updates applied?  I tested applying the Hotfix to an instance that was on CU12 and it does allow you to apply it, but everyone is wondering if it only applied just the 3 fixes from the Hotfix or brought it up to date with the CU13 fixes as well and I just cannot recall what the answer is to that question.

Thanks.

External Connection - Storage Emulator

$
0
0

Hi all,

I'm trying to connect my local SQL Server database instance to the blob storage emulator as an external connection, however I'm getting a "Bad or inaccessible location specified" error. Here are the steps I'm taking:

CREATE MASTER KEY ENCRYPTION BY PASSWORD = '<password>';
GO

-- Create the credentials using the generic storage account key
CREATE DATABASE SCOPED CREDENTIAL localBlobStorageCredential
WITH IDENTITY = 'devstoreaccount1',
SECRET = 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==';
GO

-- Create the data source pointing to the blob storage location I created (blob-storage-location)
CREATE EXTERNAL DATA SOURCE localBlobStorage
WITH (
    TYPE = BLOB_STORAGE,
    LOCATION = 'http://127.0.0.1:10000/devstoreaccount1/blob-storage-location',
    CREDENTIAL= localBlobStorageCredential
);
GO

-- Attempt to select a file that has been uploaded (cp.json)
SELECT * FROM OPENROWSET(
	BULK 'cp.json',
	SINGLE_BLOB,
	DATA_SOURCE = 'localBlobStorage'
) AS j;

I then get the following error:

Bad or inaccessible location specified in external data source "localBlobStorage".

Any ideas?

Regards,

James


BCP Load, mdf and ldf Growing larger than the data inserted.

$
0
0

I am using the BCP utility to bulk load data into a temp database. I have tried with simple and bulk logged recovery. 

On disk the .dat files I am loading are about 2.5GB however when I load them using BCP the .mdf file grows to 10GB and the log file grows to 14GB. 

Here is the BCP command I am using there are multiple files but I am using the same switches for all of them:

&bcp '[TempDatabase].[dbo].[View_Strings]' IN 'C:\dat\Strings.dat' -f "C:\fmt\Strings.fmt" -h TABLOCK -T -S.\SQLEXPRESS 

It takes about 13 minutes to load the data there are 659603 records inserted. But then I run into an error like this: 

Starting copy...
SQLState = 37000, NativeError = 1105
Error = [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Could not allocate space for object 'ChangeLogTemp'.'PK__iOPS_Cha__3214EC2763B71DFD' in database 'TempDatabase' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

I can shrink the database and the size goes down to just over 1GB for the mdf file and 84MB for the log file. 

Is this normal expected growth? Is there a way to prevent the file growth? Why is the database growing more that the amount of data to be loaded. the data in the .dat files is in native format. 

Here is the definition of the table I am inserting into I removed some of the columns for simplicity: 

USE [TempDatabase]
GO

/****** Object:  Table [dbo].[ChangeLogTemp]    Script Date: 1/17/2019 11:02:09 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[ChangeLogTemp](
[ID] [int] IDENTITY(1,1) NOT NULL,
[type] [varchar](1) NULL,
[Strings_Kind] [int] NULL,
[Strings_Number] [int] NULL,
[Strings_English] [nvarchar](150) NULL,
[Strings_English_usa] [nvarchar](150) NULL,

PRIMARY KEY CLUSTERED 
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO

Utility Explorer

$
0
0

Hello!

I've downloaded and installed the Developer edition of SQL Server 2016 SP1 and the latest SSMS (SSMS-Setup-ENU.exe). Now when I'm trying to open Utility Explorer I just can't find it:

???

Thank you in advance,

Michael


SQL Trigger - fire only on Particular SP

$
0
0

there is one trigger which is need to fire only when a particular SP run...

i don't want this trigger to run always ...

trigger A :   fires when tableA of column A update  

this column A  update by a procedure A


Requirement:

This trigger only fires, when through the Procedure A,

The trigger does not fire, if i manually or any other Proc  update column A  

compatibility level Change from 100 to 120

$
0
0

Hi Experts,

we have migrated few databases from SQL server 2008 to SQL server2014  Standard Edition butCompatibility level was not changed and some more information those databases are configured with mirroring, is there any impact on application if I change compatibility level from 100 to 120? I have read that by changing the compatibility level does not have any performance issues apart from improvement in the performance we can  have new feature which are in SQL server 2014 and please correct me if I am wrong finally I have question any impact on mirroring or application Functionality


Who dropped a user from a server?

$
0
0

Hi guys, 

Is there a way to know who dropped a user from a server?

Many Thanks

SQL Server 2014 Express install error "Wait on the Database Engine recovery handel failed."

$
0
0

Install SQL Server 2014 Express on Windows 10 1809. An error occurred.

And I have tried as the solution from following article to change account of service to NT AUTHORITY\SYSTEM. But it doesn't help.
https://www.mssqltips.com/sqlservertip/4526/sql-server-install-error-wait-on-the-database-engine-recovery-handle-failed/

Thank you for any help in advance. 

Overall summary:
  Final result:                  Failed: see details below
  Exit code (Decimal):           -2061893606
  Start time:                    2019-01-18 13:57:59
  End time:                      2019-01-18 14:07:46
  Requested action:              Install

Setup completed with required actions for features.
Troubleshooting information for those features:
  Next step for SQLEngine:       Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Next step for Replication:     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.


Machine Properties:
  Machine name:                  DESKTOP-5CJG5D2
  Machine processor count:       6
  OS version:                    Windows 8
  OS service pack:               
  OS region:                     United States
  OS language:                   English (United States)
  OS architecture:               x64
  Process architecture:          64 Bit
  OS clustered:                  No

Product features discovered:
  Product              Instance             Instance ID                    Feature                                 Language             Edition              Version         Clustered  Configured

Package properties:
  Description:                   Microsoft SQL Server 2014 
  ProductName:                   SQL Server 2014
  Type:                          RTM
  Version:                       12
  Installation location:         C:\Users\OCTAX\Desktop\SQLEXPR2014_x64_ENU\x64\setup\
  Installation edition:          Express

  Slipstream:                    True
  SP Level                       2

Product Update Status:
  Success: KB 3171021

Product Updates Selected for Installation:
  Title:                         Microsoft SQL Server 2014  Express SP2
  Knowledge Based Article:       KB 3171021
  Version:                       12.2.5000.0
  Architecture:                  x64
  Language:                      1033

  Update Source:                 Slipstream


User Input Settings:
  ACTION:                        Install
  ADDCURRENTUSERASSQLADMIN:      true
  AGTSVCACCOUNT:                 NT AUTHORITY\NETWORK SERVICE
  AGTSVCPASSWORD:                *****
  AGTSVCSTARTUPTYPE:             Disabled
  ASBACKUPDIR:                   Backup
  ASCOLLATION:                   Latin1_General_CI_AS
  ASCONFIGDIR:                   Config
  ASDATADIR:                     Data
  ASLOGDIR:                      Log
  ASPROVIDERMSOLAP:              1
  ASSERVERMODE:                  MULTIDIMENSIONAL
  ASSVCACCOUNT:                  <empty>
  ASSVCPASSWORD:                 <empty>
  ASSVCSTARTUPTYPE:              Automatic
  ASSYSADMINACCOUNTS:            <empty>
  ASTEMPDIR:                     Temp
  BROWSERSVCSTARTUPTYPE:         Disabled
  CLTCTLRNAME:                   <empty>
  CLTRESULTDIR:                  <empty>
  CLTSTARTUPTYPE:                0
  CLTSVCACCOUNT:                 <empty>
  CLTSVCPASSWORD:                <empty>
  CLTWORKINGDIR:                 <empty>
  COMMFABRICENCRYPTION:          0
  COMMFABRICNETWORKLEVEL:        0
  COMMFABRICPORT:                0
  CONFIGURATIONFILE:             
  CTLRSTARTUPTYPE:               0
  CTLRSVCACCOUNT:                <empty>
  CTLRSVCPASSWORD:               <empty>
  CTLRUSERS:                     <empty>
  ENABLERANU:                    true
  ENU:                           true
  ERRORREPORTING:                false
  FEATURES:                      SQLENGINE, REPLICATION, SNAC_SDK
  FILESTREAMLEVEL:               0
  FILESTREAMSHARENAME:           <empty>
  FTSVCACCOUNT:                  <empty>
  FTSVCPASSWORD:                 <empty>
  HELP:                          false
  IACCEPTSQLSERVERLICENSETERMS:  true
  INDICATEPROGRESS:              false
  INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
  INSTALLSHAREDWOWDIR:           C:\Program Files (x86)\Microsoft SQL Server\
  INSTALLSQLDATADIR:             <empty>
  INSTANCEDIR:                   C:\Program Files\Microsoft SQL Server\
  INSTANCEID:                    OCTAX
  INSTANCENAME:                  OCTAX
  ISSVCACCOUNT:                  NT AUTHORITY\Network Service
  ISSVCPASSWORD:                 <empty>
  ISSVCSTARTUPTYPE:              Automatic
  MATRIXCMBRICKCOMMPORT:         0
  MATRIXCMSERVERNAME:            <empty>
  MATRIXNAME:                    <empty>
  NPENABLED:                     0
  PID:                           *****
  QUIET:                         false
  QUIETSIMPLE:                   false
  ROLE:                          AllFeatures_WithDefaults
  RSINSTALLMODE:                 DefaultNativeMode
  RSSHPINSTALLMODE:              DefaultSharePointMode
  RSSVCACCOUNT:                  <empty>
  RSSVCPASSWORD:                 <empty>
  RSSVCSTARTUPTYPE:              Automatic
  SAPWD:                         <empty>
  SECURITYMODE:                  <empty>
  SQLBACKUPDIR:                  <empty>
  SQLCOLLATION:                  SQL_Latin1_General_CP1_CI_AS
  SQLSVCACCOUNT:                 NT AUTHORITY\SYSTEM
  SQLSVCPASSWORD:                *****
  SQLSVCSTARTUPTYPE:             Automatic
  SQLSYSADMINACCOUNTS:           DESKTOP-5CJG5D2\OCTAX
  SQLTEMPDBDIR:                  <empty>
  SQLTEMPDBLOGDIR:               <empty>
  SQLUSERDBDIR:                  <empty>
  SQLUSERDBLOGDIR:               <empty>
  SQMREPORTING:                  false
  TCPENABLED:                    0
  UIMODE:                        AutoAdvance
  UpdateEnabled:                 true
  UpdateSource:                  Slipstream
  USEMICROSOFTUPDATE:            false
  X86:                           false

  Configuration file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20190118_135743\ConfigurationFile.ini

Detailed results:
  Feature:                       Database Engine Services
  Status:                        Failed: see logs for details
  Reason for failure:            An error occurred during the setup process of the feature.
  Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Component name:                SQL Server Database Engine Services Instance Features
  Component error code:          0x851A001A
  Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
  Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.5000.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026

  Feature:                       SQL Server Replication
  Status:                        Failed: see logs for details
  Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
  Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Component name:                SQL Server Database Engine Services Instance Features
  Component error code:          0x851A001A
  Error description:             Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
  Error help link:               http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.5000.0&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026&EvtType=0xD15B4EB2%400x4BDAF9BA%401306%4026

  Feature:                       SQL Browser
  Status:                        Passed

  Feature:                       SQL Writer
  Status:                        Passed

  Feature:                       SQL Client Connectivity
  Status:                        Passed

  Feature:                       SQL Client Connectivity SDK
  Status:                        Passed

  Feature:                       Setup Support Files
  Status:                        Passed

Rules with failures:

Global rules:

Scenario specific rules:

Rules report file:               C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20190118_135743\SystemConfigurationCheck_Report.htm

SQL Server Locks up with FAIL_PAGE_ALLOCATION 1025

$
0
0

Hey,

We have this issue where our SQL Server will run fine for a day then I loose all ability to connect to it. Generally this error occurs once SQL has used up all 20gb of memory available to it.

Environment: Vmware

OS: Windows Server 2016

SQL: SQL Server 2017 Standard CU12

Ram: 24gb total (20gb as max memory in SQL)

SQL applications get "Exception during Sub_Name: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)"

Remote Desktop Fails with "An internal Error has Occurred"

I even can't log in using the VSphere console.

The only thing I can do to get it to respond is a hard reboot through VSphere.

When I look in the logs I see FAIL_PAGE_ALLOCATION 1025. Microsoft support says that this is resolved in CU10 but we have 12 installed.

Things we've tried: Reduce Max Server Memory, Increase TempDB Size, Increase Page File Size.

Any help would be greatly appreciated.



SLQCMD 2016 SP2 error:Microsoft ODBC Driver 13 for SQL Server : SSL Provider

$
0
0

Hi ,

I have two servers Windows 2008 with SQL Server 2008 and Windows 2016 with SQL Server 2016.

Now From Windows 2016 with SQL Server 2016 when I run sqlcmd to connect  Windows 2008 with SQL Server 2008 , I get following error:

***********************************************

"Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : SSL Provider: An existing connection was forcibly closed by the remote host.
.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Client unable to establish connection. "

***********************************************

Also when I use SQL management studio from Windows 2016 with SQL Server 2016 machine to connect Windows 2008 with SQL Server 2008 , I got following error:

------------------------------
A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - An existing connection was forcibly closed by the remote host.) (Microsoft SQL Server, Error: 10054)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=10054&LinkId=20476

An existing connection was forcibly closed by the remote host

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

so neither SQLCMD nor SSMS are able to establish connection with SQL Server  2008.

Please suggest if any solutions.

Attaching a Database with Filestream Error

$
0
0

I had to migrate from one machine to another.  I detached all my databases.  One of them utilized FileStream.  On the new machine, new SQL Server, it is my belief that FileStream IS enabled....Properties->Advanced->FILESTREAM Access Level->Full Access Enabled.  

However, when I try to attach my database, I get the error, "Filestream feature is disabled", and it further then says that the physical file may be incorrect.  I don't believe either to be the case.

Any suggestions?

Numeric add and Subtraction

$
0
0

I am doing the following test

TESTA

declare @valuea numeric(25,8)
declare @valueb numeric(25,2)

set @valuea=100000.455
set @valueb=234523.00

select @valueb - @valuea

In database setting compatibility 100  and 130 , the result is the same 134522.54500000

TESTB

declare @valuea numeric(38,8)
declare @valueb numeric(38,2)

set @valuea=100000.455
set @valueb=234523.00

select @valueb - @valuea

In database setting compatibility 130 , the result is 134522.55

In database setting compatibility 100 , the result is  134522.54  

Interesting ??

According to https://support.microsoft.com/en-us/help/4010261/sql-server-and-azure-sql-database-improvements-in-handling-some-data-t

Seems this only affect numeric (38,x) ??

Restore backup from other domain

$
0
0

Hi,

I am trying to take back up database in one server and restoring in other domain.

i want to access domain server A folder from other domain server B and restore it.

So below things i performed. 

I took backup of the db and saved in A server folder called abc.

For that particular folder i did "Map to the network folder Q"

In ssms query i did this following commands but i am getting ERROR as

A command was used with conflicting switches and More help is available by typing NET HELPMSG 3510.

EXEC sp_configure 'show advanced options', 1;

GO

RECONFIGURE;

GO


GO
RECONFIGURE;
GO
EXEC sp_configure 'xp_cmdshell',1
GO
RECONFIGURE
GOEXEC XP_CMDSHELL 'net use Q: \\A(Server ip)\abc(folder) Supp0rt@Di917E! /user:userid /savecred /p:yes'

Please let me know where i am doing mistakes.

Thanks,

jo


pols

In-Memory OLTP problems om sql-server 2017

$
0
0
Hi, I have issues with queries and recovery (after shutdown) on a sql server 2017 where about 43% of the memory is moved into OLTP tables directly or by recovery. It seems that optimized queries use so much memory that there is not enough left to complete the task. If I divide the query sequentially, it goes well, but upon recovery after shutdown, the database will not be able to return to normal mode. Linking the database to your own memory pool helps nothing.
Viewing all 15889 articles
Browse latest View live


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