I would like to extract SQL server (event) log information into text file or DB tables so that we can read it with a script everyday.
Could you please advise how that can be done?
Thanks in advance!
Pingx
pingx
I would like to extract SQL server (event) log information into text file or DB tables so that we can read it with a script everyday.
Could you please advise how that can be done?
Thanks in advance!
Pingx
pingx
I am very familiar with running SQL Profiler with a set of "minimally invasive" template options and the info is extremely useful.
I am not as familar with the content of the results from running the DMV queries.
Can the DMV views provide the same info as "SQL Profiler" does?
Hi,
We are trying to run following query in SQL cmd but it is failing error.
SQLCMD query
Code
:setvar Mode [$Mode]
:setvar Version [$Version]
:setvar LogicImageDir [$LogicImageDir]
:setvar DatabaseName [$Database]
:setvar DefaultFilePrefix "test"
:setvar DefaultDataPath "C:\MSSQL\Data\"
:setvar DefaultLogPath "C:\MSSQL\Log\"
GO
:on error exit
GO
/*
Detect SQLCMD mode and disable script execution if SQLCMD mode is not supported.
To re-enable the script after enabling SQLCMD mode, execute the following:
SET NOEXEC OFF;
*/
:setvar __IsSqlCmdEnabled "True"
GO
IF N'$(__IsSqlCmdEnabled)' NOT LIKE N'True'
BEGIN
PRINT N'SQLCMD mode must be enabled to successfully execute this script.';
SET NOEXEC ON;
END
GO
USE [$(DatabaseName)]; -- execution
gives an error at this point
-----not the complete code
Error
Appreciate your help. Thank you.
Hi Team
We are facing the issue on SQL cluster 2016 servers . SQL services self stop and start after 2 or 3 days and finding only I/O related error in default logs location as well generate the memory dump after 4 or 3 days "N:\MSSQL13.SQL3B\MSSQL\LOG\SQLDump0018.mdmp" . and no failover happens after services UP
And this issue is occurring our all production servers .
SQL server 2016 SP 1
Windows server 2012
Regards
Dinesh
I'm not sure the best place to ask this so I figured I'd ask here. I work in a large shop with 100s of SQL Servers mostly running Enterprise Edition. I'd like to convert many of the non-production (development, acceptance testing, etc) to Developer Edition. I've come across this statement in the licensing guide though and cant get a clear answer from anyone as to what it means...
"SQL Server Developer Edition may not be used in a production environmentor with commercial data"
"Production environment" is pretty self-explanatory but what exactly is "commercial data"? For example if in a production environment I encounter an application bug or performance issue that I can only reproduce with data from the production environment, am I not allowed to copy the production data to a server running Developer Edition for debugging purposes?
Is there a difference between "production" data and "commercial" data? Is commercial data perhaps data that I purchased - say marketing data - that I want to perform analysis on? That's not the sort of thing I want to do with DE. I simply want to troubleshoot on a non-production server using production data.
Chuck
Hi,
I am trying to download SQL Server 2017 web edition. But not finding the link in microsoft website.
Its showing as : See your hosting partner for pricing. (Hosting only)
May i know what is mean by this? Can anyone give inputs how to download web edition?
Thanks,
Jo
pols
Hi Everyone,
I am trying to update my Nortridge (NLS) Program and their customer support is unable to help me with creating a test database on my SQL server. I was able to create a new, blank database but am not able to backup my NLS database and restore it to the blank database.
It looks like it is backing up but when I go to select the file to restore it it does not show a .bak file.
Can anyone help me with this?
Trying to import data from Excel is giving this message.
Office365 64-bit
Here's what I tried:
1) I installed the 64-bit Access database engine 2016
2) I tried the 2010 & 2007 versions as well
3) I reinstalled Office365
I'm out of ideas. What else could be going on here?
Getting error while using SSMA tool
Synchronize with database
Error :
An unexpected error occurred. Please send the log file to product support. For more information, see "Getting SSMA Assistance" in the product documentation.
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
Product Details
SSMA for Sybase : V8.1.0
MS SQL Server 2016
Sybase ASE 15.7
I have an SQL Server 2016 database set to full recovery mode which is ~400Mb however the log is almost 30Gb. Whether I perform a full backup in SSMS or using tsql or manually try to shrink it, it wont lower in size. It shows 99% available free space when
attempting to shrink.
There are no open transactions reported by DBCC OPENTRAN, however the application that accesses the database has a Window service which when stopped allows the log file to be flushed.
What can I report through SQL Server that may indicate what the developer has done causes this?
Thanks.
I have set up a linked server connection to import excel 2016 file 64 bit sheets.
This has been running with no problems for 1 1/2 years. I can run the script repeatedly for approx 5 minutes then I get error messages as below:
Msg 7399, Level 16, State 1, Line 46
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "lkExcelImport" reported an error. The provider reported an unexpected catastrophic failure.
Msg 7303, Level 16, State 1, Line 46
Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "lkExcelImport".
I have one linked server to another sql server DB and this works continually.
I have to restart the server 1 or more times to reestablish the connection. Once the connection is working I test and can rerun the script for about 5 minutes before it stops again.
There have been no changes to the scripts or the excel spreadsheets.
what's the different between database status Suspect vs Recovery Pending. ???
what's are the different causes for both Suspect vs Recovery Pending. ???
Hi,
total DB size 82GB,
recently removed 40GB of data from Database , so i try to shrink DB files to claim space. ( so the wizard should show approximately Available Free space 40000 MB)
when i check in wizard it shows wrong data, but in dbcc SHOWFILESTATS shows right value.
am using SSMS 18.4 & SQL 2019,
Wizard Result:
DBCC Result:
Hi,
I am new to this DBA role. Please suggest solution to resolve this issue.
Issue:
In my secondary server all user databases are in synchronizing state and the log file drive is full. I tried to do a shrink on the ldf files. but I could not do anything against the databases.
Regards
Priya
Workflow:
On April 29th I created a new temporal table named [dbo].[FactPersonnelScheduleDetails_Current] with a default history table named [History].[FactPersonnelScheduleDetails_Current].
This table is in a data warehouse that performs several merge statements on an hourly basis.
Twice now since implementing this table 4 days ago, the merge transaction has failed with the following error: "Attempting to set a non-NULL-able column's value to NULL"
The History table has one user-defined index. As soon as I drop that index, I can the successfully complete the merge.
Any suggestions why the MERGE is failing when I have a user defined index created on the history table, but works when I remove the user defined index?
CREATE TABLE [dbo].[FactPersonnelScheduleDetails_Current] ( [ScheduleCellKey] INT NOT NULL, [ScheduleCellID] INT NOT NULL, [DBID] SMALLINT NOT NULL, [ScheduleDetailsID] INT NOT NULL, [RecordNumber] SMALLINT NULL, [WorkDate] DATE NULL, [WorkDateKey] INT NULL, [WeekStartDate] DATE NULL, [DayOfTheWeek] VARCHAR(50) NULL, [WorkDayNumber] TINYINT NULL, [MasterScheduleCellKey] INT NULL, [WorkingScheduleMatchesMasterScheduleFlag] VARCHAR(3) NULL, [DateWorkingScheduleNoLongerMatchesMaster] DATETIME2(7) NULL, [IsHoliday] VARCHAR(3) NULL, [JobPostDetailID] INT NULL, [JobPostDetailKey] INT NULL, [JobNumber] VARCHAR(10) NOT NULL, [JobKey] INT NOT NULL, [JobTierKey] INT NOT NULL, [EmployeeNumber] INT NULL, [EmployeeKey] INT NULL, [CategoriesDetailID] INT NULL, [BillCategory] VARCHAR(50) NULL, [HoursTypeID] SMALLINT NULL, [HoursTypeDescription] VARCHAR(50) NULL, [PaycheckDescriptionId] SMALLINT NULL, [PaycheckDescription] VARCHAR(50) NULL, [RecordTypeID] TINYINT NULL, [Hours] DECIMAL(19,4) NULL, [InTime] TIME(3) NULL, [InTimeString] VARCHAR(8) NULL, [InDateTime] DATETIME NULL, [OutTime] TIME(3) NULL, [OutTimeString] VARCHAR(8) NULL, [OutDateTime] DATETIME NULL, [LunchHours] DECIMAL(19,4) NULL, [NextDay] VARCHAR(3) NOT NULL, [PayRate] MONEY NULL, [SpecialPayRate] VARCHAR(3) NOT NULL, [ForceOTToThisJob] VARCHAR(3) NOT NULL, [OvertimeHours] DECIMAL(19,4) NULL, [DoubletimeHours] DECIMAL(19,4) NULL, [InvoiceNumber] INT NULL, [InvoiceDescription] VARCHAR(100) NULL, [TierDescription] VARCHAR(100) NULL, [BillRate] MONEY NULL, [SpecialBillRate] VARCHAR(3) NOT NULL, [BillingPayRate] MONEY NULL, [NonBillableTypeID] SMALLINT NULL, [NonBillableTypeDescription] VARCHAR(50) NULL, [LastChangedBy] VARCHAR(20) NULL, [LastChangedDate] DATETIME NULL, [DaysBetweenWorkDateAndModifiedDate] INT NULL, [UpdatedToTKHours] VARCHAR(3) NULL, [SpecialInvoiceDescription] VARCHAR(3) NULL, [SpecialTierDescription] VARCHAR(3) NULL, [InvoiceDetailID] INT NULL, [TTMStatusID] INT NULL, [IsConfirmed] VARCHAR(3) NULL, [DateConfirmed] DATETIME NULL, [IsPublished] VARCHAR(3) NULL, [AcceptedTypeForPSTT] TINYINT NULL, [TeamTimeAcceptedTypeDescription] VARCHAR(50) NULL, [UserName] VARCHAR(20) NULL, [DateChanged] datetime NULL, [Notes] VARCHAR(255) NULL, [SystemNotes] VARCHAR(8000) NULL, [ETLDateChanged] DATETIME2(7) NOT NULL DEFAULT (sysdatetime()), [RecordInsertTimestamp] DATETIME2(7) NOT NULL DEFAULT (sysdatetime()), [RecordUpdateTimestamp] DATETIME2(7) NOT NULL DEFAULT (sysdatetime()), SysStartTime datetime2(0) GENERATED ALWAYS AS ROW START CONSTRAINT DF_SysStart DEFAULT SYSUTCDATETIME(), SysEndTime datetime2(0) GENERATED ALWAYS AS ROW END CONSTRAINT DF_SysEnd DEFAULT CONVERT(datetime2 (0), '9999-12-31 23:59:59'), PERIOD FOR SYSTEM_TIME (SysStartTime, SysEndTime), CONSTRAINT PK_FactPersonnelScheduleDetails_Current PRIMARY KEY NONCLUSTERED (ScheduleCellKey)) WITH (SYSTEM_VERSIONING = ON (HISTORY_TABLE = History.FactPersonnelScheduleDetails_Current)); CREATE CLUSTERED INDEX [IX01_FactPersonnelScheduleDetails_Current] ON [dbo].[FactPersonnelScheduleDetails_Current] (WorkDateKey,DBID); CREATE NONCLUSTERED INDEX [IX02_FactPersonnelScheduleDetails_Current] ON [dbo].[FactPersonnelScheduleDetails_Current] (JobKey) INCLUDE (ScheduleCellKey,DBID,WeekStartDate,JobTierKey,EmployeeKey,Hours,WorkingScheduleMatchesMasterScheduleFlag); CREATE NONCLUSTERED INDEX [IX03_FactPersonnelScheduleDetails_Current] ON [dbo].[FactPersonnelScheduleDetails_Current] (RecordUpdateTimestamp,MasterScheduleCellKey) INCLUDE (ScheduleCellKey,WeekStartDate,DayOfTheWeek,JobPostDetailKey,JobKey,EmployeeKey,CategoriesDetailID,Hours,InTime,OutTime,NextDay,PayRate,SpecialPayRate,ForceOTToThisJob,BillRate,SpecialBillRate,NonBillableTypeID,ETLDateChanged,RecordNumber,WorkingScheduleMatchesMasterScheduleFlag); CREATE NONCLUSTERED INDEX [IX04_FactPersonnelScheduleDetails_Current] ON [dbo].[FactPersonnelScheduleDetails_Current] (WorkingScheduleMatchesMasterScheduleFlag) INCLUDE (ScheduleCellKey,DBID,WeekStartDate,JobKey,JobTierKey,EmployeeKey,DateWorkingScheduleNoLongerMatchesMaster); CREATE NONCLUSTERED INDEX [IX01_FactPersonnelScheduleDetails_Current] ON [History].[FactPersonnelScheduleDetails_Current] (WorkDateKey,DBID) INCLUDE (ScheduleCellKey,WeekStartDate,JobKey,JobTierKey,EmployeeKey,Hours,SysStartTime,SysEndTime);
2 instances of Microsoft SQL Server 2014 (SP3-GDR) (KB4505218) - 12.0.6108.1 (X64) May 29 2019 20:05:27 Copyright (c) Microsoft Corporation Express Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)
Running on Windows Server 2012 Standard on VM.
SQL Server installed on OS drive (C); master, model, temp DB all on E drive and user databases on F drive.
Something happened the other night preventing both instances from running. I believe during an automatic update.
Application log error indicated 'Cannot recover the master database...'.
The entire C drive was restored from backup and everything is working again except for a couple of items.
Open SSMS (log in as sa) right click on the server node, click on properties presents the following
The links in the details, of course, are useless.
Viewing properties for databases works fine. The problem is only for the server properties.
Also, on the SQL Server Logs node, there are no logs available.
If I run sp_readerrorlog, the results display the log entries, so logging is working.
Both issues occur for both instances of SS.
It is not an SSMS issue as when I connect remotely, both issues persist.
I've searched, but haven't found any info on either issue. I'm thinking to try a repair of the SS install, but thought I would post here first.
Anyone have any suggestions on solving these issues?
HI All,
i have changed sql named instance name by using below query.
sp_dropserver
'Server
Name\old_Instance_name'
go
sp_addserver
'ServerName\New
Instance Name'
,
'local'
go
however
when i querying
select
@@servername
it showing new name only.
but
when i trying to connect with new name its not connecting but still able to connect with old name.
if
i am using new name with port number i can able to connect instance. in configuration manager
also
i can see old name only. is there any thing we need to change the server.
please
suggest.
Thanks
Raghavendra
Thanks & Regards Raghavendra Petla
Hi All,
this morning
02/28/2020 06:46:15 CET, I got a bugcheck on Prod cluster , the dump file is really short,
I was searching KB about this topic
thanks in advance for nay help
Diego
Resource Monitor (0x54c) Worker 0x000002A9841A2160 appears to be non-yielding on Node 2. Memory freed: 2428 KB. Last wait: MISCELLANEOUS. Last clerk: type USERSTORE_TOKENPERM<c/> name ACRUserStore-1379650-26-1. Approx CPU Used: kernel 33625 ms<c/> user 0 ms<c/> Interval: 484846.
----------------------------
Current time is 06:46:15 02/28/20.Diego scaravaggi (Freelancer)
Hi All,
Can we switch the Nth partition to a non partitioned table , so that we can truncate this or archive this data later.
Ex: If I have Daily partitions on a SQL table,
On Day1, One partition will be created with Split Range.
On Day 2, Split Range will create another day partition
On Day 3, before creating the Day3 partition, I have to Switch the Day1 partition to a non partition table and just maintain 2 partitions any time in my target (that is Current Day and Previous Day)
Here, How can we identity Getdate()-2 partition to SWITCH to a non partitioned table?
ALTERTABLE Source SWITCHPARTITION1TO Target, Here how can we set Parititon = Getdate()-2.
Thanks in advance.