|
|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Logon Trigger Messages | |
I created this trigger in SQL Server 2022:
CREATE TRIGGER checksteve ON ALL SERVER FOR LOGON AS BEGIN IF ORIGINAL_LOGIN()= N'ARISTOTLE\Steve' PRINT 'Steve logged in' END; GOWhere can I view "Steve logged in"? | |
Think you know the answer? Click here, and find out if you are right. |
Yesterday's Question of the Day (by Steve Jones - SSC Editor) |
The SQL Assessment API What is the SQL Assessment API? Answer: An API to evaluate the configuration of your SQL Server Explanation: This is a real thing, and it's in all SQL Server 2012+ instances as well as the Linux and Managed Instance versions of SQL Server. This is an API that is used to evaluate your SQL Server instance configuration for best practices based on a ruleset from Microsoft. Ref: SQL Assessment API - https://learn.microsoft.com/en-us/sql/tools/sql-assessment-api/sql-assessment-api-overview?view=sql-server-ver16 |
Database Pros Who Need Your Help |
Here's a few of the new posts today on the forums. To see more, visit the forums. |
SQL Server 2017 - Administration |
DB stuck in restoring state - A developer tried restoring a test DB 3 times and each time it was getting stuck at restoring. And when I tried restoring the DB "Restore database DBName from disk '' with recovery I ran into the same issue and I saw DB, stuck in restoring state. Sys_dm_requests doesn't show any records because I could […] |
The backup to one location fails but is successful on another - Dear Friends, Would be glad if any of you can help in a backup related issue I am stuck in. I am trying to take a database backup to two network locations , and mapped drives. The difference between the two targets is the domain. The source SSMS session from \\a.b.c.d\backup to target \\a.b.c.e\\backup works […] |
How to set execution timeout in SSMS for SQL Server - I tried to set the execution timeout in SSMS using multiple methods. Initially, I tried changing the query execution time through the tools option, as described on the website https://stackoverflow.com/questions/1137190/changing-the-commandtimeout-in-sql-management-studio Subsequently, I tried a second method from the link. In the tools design settings, we can configure values for the execution timeout in seconds. https://stackoverflow.com/questions/1137190/changing-the-commandtimeout-in-sql-management-studio […] |
SQL Server 2012 - T-SQL |
Adapt the query to 2012 - Hello I have a query that works as a loop but it is slow. How can I do this with a standard query? -- LINES tablosunu oluşturma IF EXISTS (SELECT 1 FROM SYS.tables WHERE name = 'LINES') BEGIN DROP TABLE LINES END GO CREATE TABLE LINES ( ID INT IDENTITY(1,1), CODE NVARCHAR(100), DATE_ DATETIME, TIP […] |
SQL Server 2019 - Administration |
sysmail_event_log last_mod_user has a disabled login - Hello experts, We routinely disable sa after a SQL install. However, while troubleshooting a database mail issue (test mail not received), I saw that the sysmail_event_log entries have last_mod_user of sa for some rows. How can that be if the login is disabled? How can I change it so that sa is not used here? […] |
LinkedServer error - I getting the bellow error when runing query on linkedserver from another server after adding linkedserver. OLE DB provider "MSOLEDBSQL" for linked server "xxx.xxx.x.xxx" returned message "Protocol error in TDS stream". OLE DB provider "MSOLEDBSQL" for linked server "xxx.xxx.x.xxx" returned message "Communication link failure". Msg -1, Level 16, State 1, Line 11 Session Provider: Connection […] |
SQLCMD and the permissions needed - Hey all, Hopefully this is a simple question. I am trying to figure out what permissions are needed for an account to use SQLCMD. I understand sysadmin allows use of it, but we are trying to not grant this non-user account sysadmin. I have been googling and either I'm not using the right keywords or […] |
SQL Server 2019 - Development |
Filtered index prerequisites to be used - Hello, After few videos and showing how filtered indexes works, what are the prerequisites to be used and so on still I am not able to make my query using it. Now, I have table CDPOS which is over 100 milion rows. There is a statement which will run automatically, we are still in deciding […] |
Monitoring if something is deleted in DB - Hello, I have long-term task, which came one year ago, and just now I have a little free time to start working on it. I will explain a little bit of the task, and then what I have done so far. Some time ago, even before I worked here, colleagues of mine using the web-application […] |
Powershell |
Invoke-SQLCMD - If my server has dashes seems like that is throwing an error -serverinstance at-ts-cblsql is server name Anyway to get around that? THanks |
Continuous Integration, Deployment, and Delivery |
Red Gate SQL Change Automation - Hi, What's happened to this product has it now become Flyway? |
Red Gate SQL Change Automation - Hi, What's happened to this product? has this now become Flyway? |
Suggestions |
How to change password - How can I change login password of this website? I don't see option under my profile, and google give no result. Is it even possible to change password? |
SQL Server 2022 - Development |
singleton is interferring with getting multiple nodes in xml - Hi we have an xml doc shaped essentially as shown in image 2 below. Unfortunately we are so used to using the singleton structure to avoid problems that we dont know how to get multiple nodes like those inside featuresandoptions . At the moment we are only getting one occurrence of each for each line […] |
Calculating moving moving averages for different ranges in one query - I have this query, which is gives result I want (may be not, i have not checked extensively yet), i feel like it could be written in more effective way. I have to calculate moving average, for 7 , 90, 365 days, and for 3 and 12 month, for every one of them I have […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |