|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Determining the Updated Columns | |
I am creating a trigger in SQL Server 2022 and want to detect a change in a table. Here is my table DDL:
CREATE TABLE CustomerLarge ( CustomerID INT NOT NULL IDENTITY(1,1) CONSTRAINT CustomerLargePK PRIMARY KEY CLUSTERED , CustomerName VARCHAR(20) , CustomerContactFirstName VARCHAR(40) , CustomerContactLastName VARCHAR(40) , Address VARCHAR(20) , Address2 VARCHAR(20) , City VARCHAR(20) , CountryCode CHAR(3) , Postal VARCHAR(20) , creditlimit INT , discount numeric(4,2) , lastorderdate DATETIME , lastorderamount NUMERIC(10,2) , lastordercontact VARCHAR(20) , created DATETIME , modified DATETIME , modifiedby VARCHAR(20) , statusid INT , active BIT , customersize INT , primarysalesid INT) GOIf I want to detect that the creditlimit was updated, what IF statements should I use? | |
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) |
Getting Azure SQL Database Permissions When I run this on Azure SQL Database, what is returned? SELECT * FROM sys.fn_builtin_permissions('Server') AS fbp Answer: All the server level permissions that one would see on-premises Explanation: This function returns all the permissions, even if they are not valid on the platform. This looks the same in Azure SQL Database as it does in SQL Server 2022 on premises. Ref: sys.fn_builtin_permissions - https://learn.microsoft.com/en-us/sql/relational-databases/system-functions/sys-fn-builtin-permissions-transact-sql?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 2019 - Development |
built in deadlock information capture - Hi, i cannot recall the object or even if it comes off the shelf but i once saw a tool in sql server where the competing tables etc involved in a deadlock are recorded. I think you had to know a bit about the complicated looking test it provided but it was sweet. my recollection […] |
why do my advanced i/o column lengths on city keep changing - hi , every time i go back to an ssis pkg that is under construction, at least one column in a tsv needs to be reset in the advanced properties of the oledb source from 50 bytes to 256. Even though last time i edited it, i saved the pkg. why is that happening? Today […] |
Anything that is NOT about SQL! |
NKTg Law on Varying Inertia – A Different Way to Think About Motion - Hi everyone, I’d like to share something from the science side of life rather than the SQL side. It’s called the NKTg Law on Varying Inertia. In classical mechanics, Newton’s laws describe how objects move under the influence of forces. But the NKTg Law takes a different angle: instead of focusing only on forces, it […] |
Editorials |
Storage Enhancements - Comments posted to this topic are about the item Storage Enhancements |
Everyone Wants a Piece of the AI Pie - Comments posted to this topic are about the item Everyone Wants a Piece of the AI Pie |
Critical Data and Insomnia - Comments posted to this topic are about the item Critical Data and Insomnia |
Article Discussions by Author |
How to create your custom GPT SQL Expert - Comments posted to this topic are about the item How to create your custom GPT SQL Expert |
MongoDB and NodeJS in action - Comments posted to this topic are about the item MongoDB and NodeJS in action |
Data recovery from an Index - Comments posted to this topic are about the item Data recovery from an Index |
Working with Indexes on SSMS - Comments posted to this topic are about the item Working with Indexes on SSMS |
SQL Server Threats - Comments posted to this topic are about the item SQL Server Threats |
SQL Server Threats - Comments posted to this topic are about the item SQL Server Threats |
SQL Server 2022 - Administration |
Can a Database be in an AG and do log shipping at the same time? - Hello, I have a large database about 8 GB. It is in an AG. I have three replicas (Replica1, Replica2 and Replica3) Replica1 is Primary and healthy Replica2 is Secondary and heathy Replica3 is Secondary and not healthy. I need get Replica3 healthy again. My thought was to wait until after the normal backup […] |
SQL CAL based Licensing - Hi Folks, I am about to purchase SQL server licences and need your advice on the Device CAL model. I understand we have to pay for the server license and then as per device count. SO if we have 2 application servers , with each routing 5 client connections, do I have to pay for […] |
SQL Server 2022 - Development |
azure vm has to be rebooted more often than we'd like - Hi we're noticing this 2022 server gets into a funk now and then. Specifically, i notice when i script existing tables to the clipboard etc it just hangs with that circle continuing to spin. i notice that if i reboot, the problem goes away for a while. does the community have a similar experience? […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |