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

restrored only table in database

$
0
0
Hello people.Is there a possibility to restore only one or some table in database without restore backup and if no . Why ?



Who will be announced as the next SQL Server Database Engine Guru? Read more about February 2019 competition!!

$
0
0


What is TechNet Guru Competition?

Each month the TechNet Wiki council organizes a contest of the best articles posted that month. This is your chance to be announced as MICROSOFT TECHNOLOGY GURU OF THE MONTH!

One winner in each category will be selected each month for glory and adoration by the MSDN/TechNet Ninjas and community as a whole. Winners will be announced in dedicated blog post that will be published in Microsoft Wiki Ninjas blog, a tweet from the Wiki Ninjas Twitter account, links will be published at Microsoft TNWiki group on Facebook, and other acknowledgement from the community will follow.

Some of our biggest community voices and many MVPs have passed through these halls on their way to fame and fortune.

If you have already made a contribution in the forums or gallery or you published a nice blog, then you can simply convert it into a shared wiki article, reference the original post, and register the article for the TechNet Guru Competition. The articles must be written in February 2019 and must be in English. However, the original blog or forum content can be from beforeFebruary 2019.

Come and see who is making waves in all your favorite technologies. Maybe it will be you!


Who can join the Competition?

Anyone who has basic knowledge and the desire to share the knowledge is welcome. Articles can appeal to beginners or discusse advanced topics. All you have to do is to add your article to TechNet Wiki from your own specialty category.


How can you win?

  1. Please copy/Write over your Microsoft technical solutions and revelations to TechNetWiki.
  2. Add a link to your new article on THIS WIKI COMPETITION PAGE (so we know you've contributed)
  3. (Optional but recommended) Add a link to your article at the TechNetWiki group on Facebook. The group is very active and people love to help, you can get feedback and even direct improvements in the article before the contest starts.

Do you have any question or want more information?

Feel free to ask any questions below, or Join us at the official MicrosoftTechNet Wiki groups on facebook. Read More about TechNet Guru Awards.

If you win, people will sing your praises online and your name will be raised as Guru of the Month.


PS: Above top banner came from Vimal Kalathil.



Dave Rendon - wikiazure

SQL Agent service Not Starting (already used LocalSystem)

$
0
0

This is my SQL Agent log file...I also try to uninstall and reinstall but it show same error

2019-02-18 17:52:49 - ? [000] Event Global\sqlserverRecComplete opened
2019-02-18 17:52:49 - ? [100] Microsoft SQLServerAgent version 14.0.1000.169 (X64 unicode retail build) : Process ID 4384
2019-02-18 17:52:49 - ? [495] The SQL Server Agent startup service account is WORKGROUP\Laptopname$.
2019-02-18 17:52:49 - ! [298] SQLServer Error: 18456, Login failed for user 'WORKGROUP\Laptopname$'. [SQLSTATE 28000]
2019-02-18 17:52:49 - ! [150] SQL Server does not accept the connection (error: 0). Waiting for Sql Server to allow connections. Operation attempted was: Verify Connection On Start.
2019-02-18 17:52:49 - ! [000] Unable to connect to server '(local)'; SQLServerAgent cannot start
2019-02-18 17:52:49 - ! [298] SQLServer Error: 18456, Login failed for user 'WORKGROUP\Laptopname$'. [SQLSTATE 28000]
2019-02-18 17:52:49 - ! [382] Logon to server '(local)' failed (DisableAgentXPs)
2019-02-18 17:52:49 - ? [098] SQLServerAgent terminated (normally)

Performance Issue with INSERT..SELECT statement in SQL Server 2017 version 14.0.3048 Express Edition.

$
0
0

Hello Everyone,

I am facing a peculiar performance issue on SQL Server 2017 version 14.0.3048 Express Edition.

I have upload the DB backup, Test Query and Query Results on Onedrive.

DB Backup (1.5 MB): https://1drv.ms/u/s!AuV9gXqFVffxhGdGu57j7sGfV7MQ

Test Query(1 KB): https://1drv.ms/u/s!AuV9gXqFVffxhGk2IBl5xfcWx9is

Query Result (1 KB): https://1drv.ms/t/s!AuV9gXqFVffxhGjP5C7stsKAv9St

In the Test Query there are two commands, COMMAND 1 and COMMAND 2.

In the Query Result we can see that:

COMMAND 1 takes 89968 ms = 89.9 seconds (approx), and COMMAND 2 takes 115296 ms = 115.2 secoconds (approx).

The result of COMMAND 1 is a single value (183).

The only difference between COMMAND 1 and COMMAND 2 is: COMMAND 1 returns the result to the client, where COMMAND 2 stores the result in a table.

Why does SQL Server take and extra (115.2 - 89.9) = 25.3 seconds to store a single value (183) is the perm table called Temp? Any guess?

Thanks!



Query transaction used

$
0
0

How to find out how many transaction log is used by a query/transaction ??

1. from dmv?

2. from fn_dblog()?

How to disable default constraint synchronization on sql server publisher article

$
0
0

I have configured a sql server transnational replication. it includes one table A, and when I add a default constraint for one column of table A on publisher, it will sync to subscriber object by default.

Is there any one option to disable this behavior. just because the data on subscriber table should be from publisher database, there is no need to sync all these constraints to subscriber.It does not make sense.

SQL Agent service Not Starting

$
0
0

This error occur while i'm starting SQL Agent service

2019-02-19 15:09:54 - ? [000] Event Global\sqlserverRecComplete opened
2019-02-19 15:09:54 - ? [100] Microsoft SQLServerAgent version 14.0.1000.169 (X64 unicode retail build) : Process ID 10896
2019-02-19 15:09:54 - ? [495] The SQL Server Agent startup service account is WORKGROUP\LAPTOP-O3BBCCEI$.
2019-02-19 15:09:55 - ? [393] Waiting for SQL Server to recover database 'msdb'...
2019-02-19 15:09:55 - ! [298] SQLServer Error: 229, The EXECUTE permission was denied on the object 'sp_sqlagent_update_agent_xps', database 'msdb', schema 'dbo'. [SQLSTATE 42000] (DisableAgentXPs)
2019-02-19 15:09:55 - ! [000] The EXECUTE permission was denied on the object 'sp_sqlagent_update_agent_xps', database 'msdb', schema 'dbo'. [SQLSTATE 42000] (Error 229)
2019-02-19 15:09:55 - ! [298] SQLServer Error: 229, The EXECUTE permission was denied on the object 'sp_sqlagent_update_agent_xps', database 'msdb', schema 'dbo'. [SQLSTATE 42000] (DisableAgentXPs)
2019-02-19 15:09:55 - ! [000] The EXECUTE permission was denied on the object 'sp_sqlagent_update_agent_xps', database 'msdb', schema 'dbo'. [SQLSTATE 42000] (Error 229)
2019-02-19 15:09:55 - ? [098] SQLServerAgent terminated (normally)

Non-yielding Scheduler first time to happen on a new server

$
0
0

I have been running a stable database for 1 year and recently I moved to a new server that uses NVME drives.

Just after 3 days with the new server, I noticed the database performance is very slow and alot of dumps and event logs are being created

I am using Windows server 2016, MSSQL 2012 SP4 with latest updates.

I already tried DBCC checkdb with no errors and like I said the same configuration was stable for 1 year without a single crash and I just moved the same configuration to a new server that use NVME drives.

Process 0:0:0 (0x16e0) Worker 0x0000000CB3822160 appears to be non-yielding on Scheduler 2. Thread creation time: 13194934683908. Approx Thread CPU Used: kernel 1843 ms, user 15890093 ms. Process Utilization 78%%. System Idle 20%%. Interval: 19958666 ms.

Loading Dump File [D:\SQLDump0001\SQLDump0001.mdmp]
Comment: 'Program fault handler'
Comment: '02/18/19 05:37:21 spid 10 Exception 0xc0000005 EXCEPTION_ACCESS_VIOLATION reading address FFFFFFFFFFFFFFFF at 0x00007FFD409A9874
'
User Mini Dump File: Only registers, stack and portions of memory are available

************* Path validation summary **************
Response Time (ms) Location
Deferred srv*
Symbol search path is: srv*
Executable search path is:
Windows 8 Version 9200 MP (8 procs) Free x64
Product: Server, suite: TerminalServer SingleUserTS
Machine Name:
Debug session time: Mon Feb 18 05:37:22.000 2019 (UTC + 2:00)
System Uptime: 2 days 6:25:57.186

Update Statistics in multiple SQL Agent jobs

$
0
0
What is the impact of updating statistics using multiple statistics maintenance jobs?  I want to test Ola Hallengren's @UpdateStatistics, but I already have a native SQL Server maintenance task for statistics update.  I know, the obvious is disable one or the other while testing.  But just curious what impact multiple jobs might have.

How to shrink log file

$
0
0

Hi ,

Log reuse wait desc showing as log backup and I'm unable to take the same as log shipping is configured for that database.

Taking log backup will break the LSN chain. How can I proceed.

Thanks.

DMV sys.dm_exec_query_stats

$
0
0

I am having a store procedure sp_1

in sp_1 there are three insert statements.

I execute

exec sp_1, the store proc completed

and I use the following query to check the performance of each insert inside the store proc.  But I can't find.Any Idea ?

select …..FROM sys.dm_exec_query_stats AS qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st

Windows 2016 SQL Server STD after update reverts back to older restore point

$
0
0

Hi All,

I hope you can help, I'm having a real problem with my SQL server 2016 VM (standard), when i do the windows update and restart the VM it somehow reverts the database's back to a version from over a month ago. So i have to quickly restore the backup db before anyone writes anything to the "Old version" of the db. which is mad! 

I dont see anything in the event logs to indicate what the issue is and it doesnt happen any other server i have - its a real head scratcher!

Any one got any ideas?

Cheers

Daniel


Always ON --- SQL authentication user

$
0
0

I noticed that I have to created same username/password as SQL login for a database in Always ON group, but after adding a new database to the AG group, on secondary node, the database is read only and the SQL login cannot be mapped to the sql user inside the database, the question is will the database automatically mapped the the sql login on secondary node in the case of failover? I don't think it will as the user being created on secondary node have different sid despite they have same user/pass.

So question, how to handle the databases in AG group with application access by sql authentication?

my thought would be copy the sql login with same SID on primary node and copy it to secondary, will that work?

Publishing Web Services from SQL Server 2014

$
0
0

Hi,

I am currently using SQL Server 2014 and need to publish a view as a web service for consumption by an ETL tool.

I have followed all the steps mentioned under generating and publishing scripts wizard for SQL Server and getting the error below:

Client found response content type of '', but expected 'text/xml'.

The request failed with an empty response. (System.Web.Services)

I’ve reinstalled the Web Deploy using the Recommended MSFT installer tools via the web and tested again locally and it’s still returning the same message as above.

Any help/guidance would be appreciated.

Thanks!

Getting contents of one database into another database with exceptions?

$
0
0

Hello,

we have two databases, productive and development. We need to clone the contents of the productive database into the development database to be able to test stuff on actual cases.

What we want to do is to basically clear all content from the development database, but leave the structure intact, and then fill it with the content of the productive database. So it is changing content without changing the tables and stuff. The tables are the same in both database, but one - the development database has an additional table. This table and its content must not be changed.

Question is, if I now empty all tables in development (but the exception), can I use the backup and restore function of the management studio to fill the development database's tables with the content of the productive database's table? If not, is there another way to do this without too much effort?


Mirror is disconnected, Status is Showing (Mirror, Disconnected / In Recovery)

$
0
0
Hi,

We have 2 servers in the mirror. Currently mirror server database status is "(Mirror, Disconnected / In Recovery)".

We don't have any witness server.

Please suggest step by step suggestion to resolve the problem.

Why have multiple nonclustered indexes.

$
0
0

Hi,

This might be a simple question, but I still need to ask it.

Why is it not sufficient just to have one nonclustered which covers every column instead of having lot of little indexes with different column combinations?

Thanks,

Ben


Mr Shaw... One day I might know a thing or two about SQL Server!

Import of Microsoft Distributed Transaction Coordinator (MS DTC) transaction failed: 0x8004d00e(XACT_E_NOTRANSACTION).

$
0
0

Hi
I have upgraded an SQL 2012 server to SP4 and 24 hours after the upgrade a had a spate of 4 of the following errors in the SQL event log.

Import of Microsoft Distributed Transaction Coordinator (MS DTC) transaction failed: 0x8004d00e(XACT_E_NOTRANSACTION).

Error: 8509, Severity: 16, State: 1.

The server has a second instance of SQL2008 on it, but the error is reporting from the 2012 Server.

The server is not part of a cluster.

SAGECRM is the software using  jTDS to talk to a database on the server.

Does anyone have any ideas what may be causing this, as all other links point to it occuring only on clusters and this is not a cluster.

Thanks in advance

 

 

In-memory oltp - Checkpoint files not getting recycled

$
0
0

We have in-memory OLTP database with just one table (memory optimized). Since last 2 weeks checkpoint files are not getting flushed unless we restart services.

We have been using this table for last 2 years with no issues till earlier this month. Database just have one table which has 400K records and size of table is 500 MB.

We use this table to store user sessions and on an average we get insert/delete 60K records everyday. Number of selects is much higher but not sure if that would impact size of checkpoint file.

Below are questions we are puzzling with

  1. What gets recorded in checkpoint files and could number of selects impact size of checkpoint file
  2. How are checkpoint files managed? How and when they get cleaned up

Below are few other details in regards to environment this is happening on

  • SQL server 2016(SP1) 13.0.4001.0
  • DB compatibility level 120
  • DB recovery model - Full
  • Weekly full, Daily diff and every 30 min log backups
  • Checkpoint file of 128 MB is generated almost every minute.

Thanks

Prashant

SQL 2014 xevent memory page out.

$
0
0

When I start an xevent in sql 2014, in the sp_readerrorlog , there is a memory pageout message.

2019-02-22 15:12:26.280 spid17s      A significant part of sql server process memory has been paged out. This may result in a performance degradation. Duration: 0 seconds. Working set (KB): 593780, committed (KB): 1164284, memory utilization: 50%.

OS Windows 2012R2

OS memory : 8GB

SQL MAx memory : 7GB

Already set lock page in memory for the stating up account.

The xevent is the following :

CREATE EVENT SESSION [PSSDiag_XEvent_Block] ON SERVER
ADD EVENT sqlserver.blocked_process_report(
    ACTION(package0.event_sequence,sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.client_pid,sqlserver.database_id,sqlserver.database_name,sqlserver.is_system,sqlserver.nt_username,sqlserver.query_hash,sqlserver.request_id,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.session_server_principal_name,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.username)),
ADD EVENT sqlserver.database_xml_deadlock_report(
    ACTION(package0.event_sequence,sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.client_pid,sqlserver.database_id,sqlserver.database_name,sqlserver.is_system,sqlserver.nt_username,sqlserver.query_hash,sqlserver.request_id,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.session_server_principal_name,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.username)),
ADD EVENT sqlserver.lock_deadlock(
    ACTION(package0.event_sequence,sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.client_pid,sqlserver.database_id,sqlserver.database_name,sqlserver.is_system,sqlserver.nt_username,sqlserver.query_hash,sqlserver.request_id,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.session_server_principal_name,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.username)),
ADD EVENT sqlserver.lock_deadlock_chain(
    ACTION(package0.event_sequence,sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.client_pid,sqlserver.database_id,sqlserver.database_name,sqlserver.is_system,sqlserver.nt_username,sqlserver.query_hash,sqlserver.request_id,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.session_server_principal_name,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.username)),
ADD EVENT sqlserver.xml_deadlock_report(
    ACTION(package0.event_sequence,sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.client_pid,sqlserver.database_id,sqlserver.database_name,sqlserver.is_system,sqlserver.nt_username,sqlserver.query_hash,sqlserver.request_id,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.session_server_principal_name,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.username))
WITH (MAX_MEMORY=200800 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=10 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=PER_CPU,TRACK_CAUSALITY=OFF,STARTUP_STATE=OFF)
GO

Viewing all 12644 articles
Browse latest View live


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