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

Function call through Linked Server returns wrong value

$
0
0

I have a SQL Server agent job that runs daily, and the first step is to check that a required process finished on another server.  This check is done through a function, which I'm calling through openquery and a linked server.  The job also uses a bit of dynamic sql to add needed parameters:

set @command = 'SELECT @result = [ReturnValue]  from openquery([amlidw],''select [amlidw].[dbo].[process_control_checkrun](''''' + @parent_process_key + ''''',''''' + @child_process_key + ''''',' + ISNULL('''''' + @parent_process_key2+ '''''','default') + ',default) AS [ReturnValue]'') '


exec sp_executesql @command,N'@result int output',@result=@result output

This function will run correctly, and return the correct results for several days.  Then it will start returning 0 when the correct value is 1.  I have even gone so far as to use SQL Server Profiler to check the query being sent, then run it myself on the target server.  In this case it correctly returns 1 on the target server, but the openquery version returns 0.

The only way I can get the correct results again is to make a trivial change to the query.  For instance, I can change the name of the return value to ReturnValueTest, and the function will return correct results for several days.  This would suggest that the return value is somehow being cached until the text changes.

What is going on here?  Is there a way to ensure that the results will be returned correctly across servers?  I could experiment with different way to call the function, but not knowing the cause, I don't exactly know what to do differently.

Both severs in this scenario are SQL Server 2017, and the linked server provider is SQLOLEDB.  Thanks for any insight this group may have.  This one really has me stumped.

  

deadlock frequently happen

$
0
0

deadlock happen V.frequently, how to prevent from this, deadlock grap xml attached

<deadlock><victim-list><victimProcess id="process55c2667468" /></victim-list><process-list><process id="process55c2667468" taskpriority="0" logused="13568900" waitresource="KEY: 7:72057595418116096 (34f0ad269d12)" waittime="22236" ownerId="326851186" transactionname="UPDATE" lasttranstarted="2019-01-13T19:51:44.240" XDES="0x5b9e81b880" lockMode="X" schedulerid="6" kpid="5148" status="suspended" spid="90" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2019-01-13T18:15:14.837" lastbatchcompleted="2019-01-13T18:15:14.837" lastattention="1900-01-01T00:00:00.837" clientapp="SQLAgent - TSQL JobStep (Job 0xBF20AF18F172984A881F632A2F7007A0 : Step 2)" hostname="SQL-act" hostpid="3964" loginname="NT AUTHORITY\NETWORK SERVICE" isolationlevel="read committed (2)" xactid="326851186" currentdb="7" currentdbname="act" lockTimeout="4294967295" clientoption1="671219744" clientoption2="128056"><executionStack><frame procname="act.dbo.t_invoices_po_journal" line="12" stmtstart="698" stmtend="1508" sqlhandle="0x03000700ee24757b93c0320168a5000000000000000000000000000000000000000000000000000000000000">
with source as (
	select ojorder_number from inserted where ojorder_number is not null
	union
	select ojorder_number from deleted where ojorder_number is not null
)
merge into po_order_deductions_processing_queue as target
using source
on source.ojorder_number = target.id
when matched then update set ts = getdate()
when not matched then insert (id,source)values(source.ojorder_number,'invoice')    </frame><frame procname="act.dbo.sp_inventory_master" line="226" stmtstart="15266" stmtend="16702" sqlhandle="0x0300070014fc2b3f5ffa1b0198a9000001000000000000000000000000000000000000000000000000000000">
with a as (
	select po.oid,po.ref_number,i.Merchandise_Total,round(sum(isnull(nullif(poi.unit_cost_oj,0),poi.unit_cost) * poi.qty),2) mdse
	from invoices i 
	join [sql.commercedb.com].commercedb.dbo.purchase_order po on po.oid = i.OJOrder_Number
	join [sql.commercedb.com].commercedb.dbo.purchase_order_items poi on poi.poid = po.id
	where i.VendorID = 184
	group by po.oid,po.ref_number,i.Merchandise_Total
	having i.Merchandise_Total &lt;&gt; round(sum(isnull(nullif(poi.unit_cost_oj,0),poi.unit_cost) * poi.qty),2)
) 
update i set Merchandise_Total = a.mdse, [Total Invoice] = a.mdse
from invoices i 
join a on a.oid = i.OJOrder_Number and i.Invoice_Number =  concat('EST ',a.ref_number)
where i.VendorID = 18    </frame><frame procname="adhoc" line="1" stmtend="46" sqlhandle="0x0100070051381f0560decb8c5b00000000000000000000000000000000000000000000000000000000000000">
exec sp_inventory_maste    </frame></executionStack><inputbuf>
exec sp_inventory_master   </inputbuf></process><process id="process6a33c23c28" taskpriority="0" logused="17465596" waitresource="KEY: 7:72057595418116096 (7264c9362d21)" waittime="530" ownerId="326851289" transactionname="user_transaction" lasttranstarted="2019-01-13T19:51:45.413" XDES="0x5c31c177e0" lockMode="X" schedulerid="8" kpid="10412" status="suspended" spid="71" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2019-01-13T19:52:33.393" lastbatchcompleted="2019-01-13T19:52:33.390" lastattention="1900-01-01T00:00:00.390" clientapp="SQL-L-1_commercedb_commercedb_tran_pub" hostname="SQL-L-1" hostpid="8608" loginname="cloudvm\SQL-L-1$" isolationlevel="read committed (2)" xactid="326851289" currentdb="8" currentdbname="commercedb" lockTimeout="4294967295" clientoption1="671219744" clientoption2="128056"><executionStack><frame procname="commercedb.dbo.t_purchase_order_po_journal_queue" line="5" stmtstart="250" stmtend="990" sqlhandle="0x03000800a34e6c693576cc0039a8000000000000000000000000000000000000000000000000000000000000">
with source as (
		select oid from inserted where oid is not null
		union
		select oid from deleted where oid is not null
	)
	merge into act.dbo.po_order_deductions_processing_queue as target
	using source
	on source.oid = target.id
	when matched then update set ts = getdate()
	when not matched then insert (id,source)values(source.oid,'purchase_order')    </frame><frame procname="commercedb.dbo.t_purchase_order_items_po_journal_queue" line="5" stmtstart="262" stmtend="714" sqlhandle="0x03000800f8e18f663276cc0039a8000000000000000000000000000000000000000000000000000000000000">
with source as (
	select poid from inserted where poid is not null
	union
	select poid from deleted where poid is not null
)
update p set status_date = p.status_date
from purchase_order p join source on source.poid = p.i    </frame><frame procname="commercedb.dbo.sp_MSupd_dbopurchase_order_items" line="3" stmtstart="1428" stmtend="6238" sqlhandle="0x03000800d47bda19f74b25012da9000001000000000000000000000000000000000000000000000000000000">
update [dbo].[purchase_order_items] set     [poid] = case substring(@bitmap,1,1) &amp; 2 when 2 then @c2 else [poid] end,     [itemid] = case substring(@bitmap,1,1) &amp; 4 when 4 then @c3 else [itemid] end,     [qty] = case substring(@bitmap,1,1) &amp; 8 when 8 then @c4 else [qty] end,     [unit_cost] = case substring(@bitmap,1,1) &amp; 16 when 16 then @c5 else [unit_cost] end,     [qty_received] = case substring(@bitmap,1,1) &amp; 32 when 32 then @c6 else [qty_received] end,     [external_sku] = case substring(@bitmap,1,1) &amp; 64 when 64 then @c7 else [external_sku] end,     [external_id] = case substring(@bitmap,1,1) &amp; 128 when 128 then @c8 else [external_id] end,     [unit_cost_oj] = case substring(@bitmap,2,1) &amp; 1 when 1 then @c9 else [unit_cost_oj] end,     [ojc_record_last_updated_ts] = case substring(@bitmap,2,1) &amp; 2 when 2 then @c10 else [ojc_record_last_updated_ts] end,     [unit_cost_oj_exp_date] = case substring(@bitmap,2,1) &amp; 4 when 4 then @c11 else [unit_cost_oj_exp_date] end,     [unit_cost_oj_promo_code] = case sub    </frame></executionStack><inputbuf>
Proc [Database Id = 8 Object Id = 433748948]   </inputbuf></process></process-list><resource-list><keylock hobtid="72057595418116096" dbid="7" objectname="act.dbo.po_order_deductions_processing_queue" indexname="PK__po_order__3213E83F020C233A" id="lock5784d4e100" mode="X" associatedObjectId="72057595418116096"><owner-list><owner id="process6a33c23c28" mode="X" /></owner-list><waiter-list><waiter id="process55c2667468" mode="X" requestType="wait" /></waiter-list></keylock><keylock hobtid="72057595418116096" dbid="7" objectname="act.dbo.po_order_deductions_processing_queue" indexname="PK__po_order__3213E83F020C233A" id="lock599ecdff00" mode="X" associatedObjectId="72057595418116096"><owner-list><owner id="process55c2667468" mode="X" /></owner-list><waiter-list><waiter id="process6a33c23c28" mode="X" requestType="wait" /></waiter-list></keylock></resource-list></deadlock>

Database is getting too big

$
0
0

We're currently running into some performance problems since our database is getting too big. Due to db size is increasing application cannot handle load and getting hang sometimes.

Database size: 16421 mb Log size: 505.0625 mb Total size: 16926.0625 mb

Recovery model: Simple Disk: C drive with 32.33 percent free space Datafile: Autogrowth is on. Growth value: 128 in units of 8 kb pages. Logfile: Will grow to a max size of 2 TB. Growth value: 10 %. Autogrow setting for db: 1024 kb.


sunnybabu

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

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


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

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?

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.

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.

SQL Server 2012 Error In Installation : Could Not Find Database Engine Startup Handle Error During installation

$
0
0

I'm getting an error while installing SQL Server Standard edition 2012 sp1 in Windows Server 2012 R2.

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.

I found a solution from technet for the same and it was not worked for me. 

According to that I have changed Database Engine & Agent Service Account to NT AUTHORITY\SYSTEM.

But I'm getting the same error Database Engine recovery handle failed.

I found the below exceptions in detail log file.

=============================

The server was unable to initialize encryption because of a problem with a security library. The security library may be missing. Verify that security.dll exists on the system.
Error: 17182, Severity: 16, State: 1.

TDSSNIClient initialization failed with error 0x139f, status code 0x80. Reason: Unable to initialize SSL support. The group or resource is not in the correct state to perform the requested operation. 
Error: 17182, Severity: 16, State: 1.

TDSSNIClient initialization failed with error 0x139f, status code 0x1. Reason: Initialization failed with an infrastructure error. Check for previous errors. The group or resource is not in the correct state to perform the requested operation. 
Error: 17826, Severity: 18, State: 3.

Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately preceding this one in the error log.
Error: 17120, Severity: 16, State: 1.

SQL Server could not spawn FRunCommunicationsManager thread. Check the SQL Server error log and the Windows event logs for information about possible related problems.

So any one have faced the same issue or since I'm new to this your help will be much appreciated.

Thanks,

Isuru



Sql servr 2014 instant to sql server 2008 r2 instance linked servers query problem

$
0
0

I'm getting the following error  on some of the linked server,when I try to query a table using a link server. The link server is created on SQL2014 instance to connect to an SQL2008r2 instance. 

"

Msg 7313, Level 16, State 1, Line 2
An invalid schema or catalog was specified for the provider "SQLNCLI11" for linked server "LEK".

"

Power Plan for SQL Server box - Configuration

$
0
0

hi

we have cloud VM installed SQL 2016 Ent sp2,  (replications & lot of triggers & main high used ProdcutionDB also there)

currently windows power plan is Balanced   , if i going to set this "high Performance" ,

system config attached below, 

how can i identify this power plan help after change to High performance? is this really required?

Viewing all 12644 articles
Browse latest View live


Latest Images

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