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

restore not working when path contains folder starting with a dot

$
0
0

Hi, i'm facing an issue with sql server 2017 express. 

when restoring a database from a path that contains a folder starting with a dot, sql server states that it cannot find the file.


this path works: 

E:\Gitlab\Runner\builds\484fdf65\0\ci\db.bak

but this path could not find the file: 

E:\Gitlab\Runner\builds\484fdf65\0\.ci\db.bak


it's not a permission issue, the folder it's the same (renamed).

the exact message is: 

 Operating system error 3(The system cannot find the path specified.)

Microsoft SQL Server 2017 (RTM) - 14.0.1000.169 (X64) express on windows server 2012 R2

is this a bug/limitation?


Service 'Microsoft.SqlServer.Management.IRegistrationService in SQL server management studio

$
0
0
Hello

I am using SQL server management studio 2012. All was working fine but just few hrs before deployement it stopped working. when i open SQL server management studio it does not loads any database inside it and shows and error 

Service 'Microsoft.SqlServer.Management.IRegistrationService' not found
(Microsoft.SqlServer.Management.SDK.SqlStudio)

TITLE: Microsoft SQL Server Management Studio
------------------------------
Service 'Microsoft.SqlServer.Management.IRegistrationService' not found (Microsoft.SqlServer.Management.SDK.SqlStudio)
------------------------------
BUTTONS:

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

Please tell me how can i fix this

Sajid

SQLServer 2017 Developer edition engine service stopped working after the update kb293803

update table stats in SQL Server 2016

$
0
0

Hi,

We are using SQL Server 2016.

How can I  check the update table stats for top 100 tables?

Please help.

Thanks




Scripts Database with exception

$
0
0

Any body know the following error ? script a sql 2005 database from SSMS version 2005

my trace flag 4199 is off on 2012.

$
0
0

hi,

   is it by default off on 2012?

and I could not understand the following lines meaning.

because the article says.

QO changes that are made to previous releases of SQL Server are enabled by default under the latest database compatibility level in a given product release, without trace flag 4199 enabled.

and the following table says that both are disabled.

https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql?view=sql-server-2017#4199

Database compatibility levelTF 4199QO changes from previous database compatibility levelsQO changes for current version post-RTM
100 to 120OffDisabledDisabled
OnEnabledEnabled

yours sincerely



Index fragmentation - regular indexes vs. columnstore

$
0
0

Hi!

We have several nonclustered columnstore indexes in the database.

When we're checking index fragmentation in SSMS, clicking  on index -> rebuild, it shows high fragmentation - about 50% or even more.

However, query based on sys.dm_db_column_store_row_group_physical_stats, shows 0 fragmentation.

Which one should we believe?

Thanks,

Alex

*** Query for reference ****

SELECT i.object_id,   
    object_name(i.object_id) AS TableName,   
    i.name AS IndexName,   
    i.index_id,   
    i.type_desc,   
    CSRowGroups.*,  
    100*(ISNULL(deleted_rows,0))/total_rows AS 'Fragmentation'  
FROM sys.indexes AS i  
JOIN sys.dm_db_column_store_row_group_physical_stats AS CSRowGroups  
    ON i.object_id = CSRowGroups.object_id AND i.index_id = CSRowGroups.index_id   
WHERE object_name(i.object_id) in ( 'Fact_Invoice_lines')   
ORDER BY object_name(i.object_id), i.name, row_group_id;  

How to change status when DB becomes read only if I attachdb to higher version?


SQL SERVER DATABASES Disappears FROM DB ENGINE WITHOUT TRACE IN LOGS.

$
0
0

HI All, 

i have situation, where sql server dbs have Disappeared from sql server. 

I have checked all the logs and couldn't find what went wrong.

is there are way I can check in system databases what went wrong ?

thanks,

DB backup During -Index maintenence / stats update

$
0
0

hi,

there is two scheduler running on prod server

1. Index online rebuild/reorganize / update Stats. 1pm to 2 pm

2 . SQL compressed backup  1.30pm to 2 pm

during 1.30 to 1.45 first job (index/stat update) failed.   but no more information on the SQLjob history?

can you explain why,   i thought need to segregate those two process (backup and maintenance )  

SQL Blocking

$
0
0

hi,

SQL server 2016 Enterprises Edition.

there are lot of blocking happens in our environment, some heavy used Transaction tables read/write frequ by applications/ webpages / Triggers &  this tables also in Replication scenario (transaction replications).

  1. as of now we use (Nolock) mechanism. but that one arrest some few blocking only ,
  2. some procedures used sp_getapplock &  sp_releaseapplock.

is there any other way to arrest (blocking of this transnational tables).

 


Unable to connect to other SQL Server

$
0
0

Hi Experts,

Unable to connect from (A -Domain1) to other server with different domain(B-Domain2). I was using the SQL Authentication, however connection is successful from other server(C - Domain3) to server(B-Domain2).

Getting below error.

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

TCP/IP and Named pipes are enabled.

Please let me know how to troubleshoot.


Vinai Kumar Gandla

Executing SQL files through command line.

$
0
0

Good morning,

I would like to use a SQL Agent job step to execute sql files from a local directory. The service account that owns the job has sysadmin rights and has full rights to the directory. When I execute the following commands from a query window in SQLCMD mode, I get good results: 

:ON Error EXIT
:r "C:\Path\filename.sql"
GO
:r "C:\Path\filename.sql"
GO
:r "C:\Path\filename.sql"
GO

However, when I place the same code into a job step and run it under type Operating system (CmdExec), I get this error:

The process could not be created for step 1 of job  (reason: The system cannot find the file specified).  The step failed.

What am I missing here?

Check which column is Always encrypted

$
0
0

1. how to check which column is always encrypted ? use dmv ?

2. How to disable the encryption of the column and delete the master and column key ?

UTF8 character set for the SQL Server DB

$
0
0

 Hi All,

I have one requirement from Client. Team Center application Database must be UTF8 character set. If other character set is used the db must be migrated to UTF8, which allows multiple language metadata.

Client requested to Set UTF-8 character for the Existing SQL Server production DB.

Current DB is Located on SQL Server 2008 R2. I want to set UTF-8 character set for Existing SQL Server Production DB.

I have seen lot of articles on google but i am not understanding.Please clarify the bellow questions.

Please tell me what is UTF-8 character?

Is it possible to set UTF-8 Character Set?

If possible how to set UTF-8 Character Set to existing production DB?

Thanks

Chandrasekhar


SQL Server Alert System: 'Severity 020'

$
0
0

SQL server 2016 SP2 :

 The client was unable to reuse a session with SPID 215, which had been reset for connection pooling. The failure ID is 50. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message

is this for connection exceeds? or authentication failure ?

what is the workaround?


SQL Server 2008 R2 - Error: 18056, Severity: 20, State:29.

$
0
0

Hello,

We are seeing errors in the SQL Server Error Log like the following:

Date  10/17/2010 11:12:10 PM
Log  SQL Server (Current - 10/18/2010 8:01:00 AM)

Source  spid401

Message
Error: 18056, Severity: 20, State: 29.

Date  10/17/2010 11:12:10 PM
Log  SQL Server (Current - 10/18/2010 8:01:00 AM)

Source  spid401

Message
The client was unable to reuse a session with SPID 401, which had been reset for connection pooling. The failure ID is 29. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.

During this time our applications are unable to connect to SQL server and are systems expericnce a significant slow down.  Our applications report the following error in the Windows Event log during the same time the error messages are logged in SQL:

"System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server.  The server was not found or was not accessible. Verify that the instance name is correct ant that SQL Server is configured to allow remote connections.  (provider: TCP Provider, err: 0 - The wait operation timed out.)"

Resources on the SQL server do not seem to be constrained at all.  This is running on a Quad 6 core 64-bit server with 128GB of RAM.  There does not seem to be a patteren to when this occurs and things seem to correct themselves automatically until the next blip.  Other posts I've seen say to look and other errors right before this, but unfortunately there are not any other errors prior to this, it is the first error we see preceeding the problem.  Any help would be greatly appreciated.

Thanks,

Henry

sleeping processes and blocks.

$
0
0

hi all,

What are the circumstances a sleeping process can create a block. We had a scenario in Prod environment where i saw one process blocking the other process. I saw parent process was running some INSERT statements and last_batch column in sp_who2 was changing every second and status is still SLEEPING. I assume this means that session was INSERTING individual rows one after another. 

Is my analysis correct? question i still have is, if session is doing INSERT each second why status is "SLEEPING" i was expecting it to be either suspended or running.


Need Power Shell Script for create database and create user in SQL Server

$
0
0

I Need your help to create database, Create user and grant role with using Power Shell script.

Thanks in advance

VBR

CDC is not working in SQL server 2014 SP2 CU10

$
0
0

Hi,

I have CDC enabled in one of the SQL Server database  2014 sp2 CU10 in AG group.CDC job has been stopped since few months back.

I can't see any error but messages in CDC view history and found no error except messages:

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

Date30/06/2018 11:09:10 AM
LogJob History (cdc.comp2_capture)

Step ID2
ServerSQL1
Job Namecdc.comp2_capture
Step NameChange Data Capture Collection Agent
Duration2.19:04:23
Sql Severity10
Sql Message ID22803
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted0

Message
Change Data Capture has scanned the log from LSN{000229B7:001D5518:0001} to LSN{000229B7:001D5568:001B}, 6 transactions with 23 commands have been extracted. To report on the progress of the operation, query the sys.dm_cdc_log_scan_sessions dynamic management view.

I have checked cdc_help_jobs

A2310A21-3401-4C56-B6AC-3A09FDD777A5capturecdc.comp2_capture500101 500
7225737D-FE8C-4646-BAB0-526C6BD15663cleanupcdc.comp2_cleanup000 02880 5000

also checked sys.dm_cdc_log_scan_sessions  

session_idstart_timeend_timedurationerror_countstart_lsncurrent_lsnend_lsnlast_commit_lsnlast_commit_timelog_record_countcommand_countfirst_begin_cdc_lsnlast_commit_cdc_lsnlast_commit_cdc_timelatencyempty_scan_countfailed_sessions_count
358572018-07-02 13:39:07.0432018-07-02 13:41:52.1300Done00000000:00000000:000000000000:00000000:000000000000:00000000:000001900-01-01 00:00:00.00000 00000000:00000000:000000000000:00000000:00001900-01-01 00:00:00.0000340

Please help me out.

Regards,

Manisha

Viewing all 15264 articles
Browse latest View live


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