|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
Multiple Defaults | |
In my SQL Server 2022 database, I run this code: ALTER TABLE dbo.OrderHeader ADD ModifiedStamp DATETIME CONSTRAINT df_Created_Getdate DEFAULT GETDATE() GOI decide I need to add auditing to another table and run this: ALTER TABLE dbo.Tracker ADD Created DATETIME CONSTRAINT df_Created_Getdate DEFAULT GETDATE() GOWhat happens with these statements? | |
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 the Updated Column List What happens when I run this code in SQL Server 2022? UPDATE dbo.CustomerLarge SET CustomerContactFirstName = 'Andy' WHERE CustomerID = 1 SELECT COLUMNS_UPDATED() Answer: NULL is returned Explanation: The COLUMNS_UPDATED() function only returns data inside of a trigger. Otherwise, this returns null. Ref: COLUMNS_UPDATED() - https://learn.microsoft.com/en-us/sql/t-sql/functions/columns-updated-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 2016 - Development and T-SQL |
Merge techniques - In Azure SQL DB, i want to merge records from the staging table to the production table. In the production table, there are 300 million records. In staging, Delta records are 40 million. there are 100+ columns in each table.... If the column value changes from staging to production, update the record. If it is […] |
Getting year part out of a string that represents a date - Hi, I have a requirement to fetch the year from an imported .csv file that can hold any kind of date , in any format as delivered to use by municipalities that manage to get their own ideas of the template they need to use. Basically the date can have many formats , like YYYY-MM-DD […] |
Dropping a PK constraint. - I will have to test this next week, but will not have a chance before Friday. My question is, if I backup table data, drop a PK to add it back as an identity PK, will the foreign keys referencing the PK still be in tact? The new PK (now with identity) will keep the […] |
SQL Server 2019 - Development |
Is there a way to implement ROWS between logic? - Hi everyone SUM function has the option to select ROWS BETWEEN parameter to allow for a rolling sum calculation. This is very useful. I would like to do the same for PERCENT_RANK but this function does not have this option available. Suppose there are 100 daily records and I want to calculate the PERCENT_RANK on […] |
Reporting Services |
SSRS error: The Value for the image 'Image1' has a constant value... - Full error message: SSRS error: The Value for the image 'Image1' has a constant value. Value requires a binary value, so it cannot be a constant. The image is in the "Page Header", and comes from a database column that was originally the image data type, but doing a convert on the query to the […] |
Editorials |
The Data Warehousing Choice - Comments posted to this topic are about the item The Data Warehousing Choice |
Shades and Reflecting on SQLBits and the Bright Future of Data - Comments posted to this topic are about the item Shades and Reflecting on SQLBits and the Bright Future of Data |
Multiple Monitoring Tools - Comments posted to this topic are about the item Multiple Monitoring Tools |
Article Discussions by Author |
The Hidden Cost of MAXDOP: CPU Spikes, Query Slowdowns, and What We Learned - Comments posted to this topic are about the item The Hidden Cost of MAXDOP: CPU Spikes, Query Slowdowns, and What We Learned |
The Hidden Cost of MAXDOP: CPU Spikes, Query Slowdowns, and What We Learned - Comments posted to this topic are about the item The Hidden Cost of MAXDOP: CPU Spikes, Query Slowdowns, and What We Learned |
How to Choose the Right Tool for MS SQL to PostgreSQL Migration - Comments posted to this topic are about the item How to Choose the Right Tool for MS SQL to PostgreSQL Migration |
SQL Server 2022 - Administration |
SQL Server 2008 to SQL Server 2022 - Hi, Is it possible to upgrade from sql server 2008 to sql server 2022, considering we have hardware req fulfilled? Or like we have to upgrade to sql server 2014/16 midway and then from there to sql server 2022 A normal backup and restore will suffice? Any ideas ? |
SQL Server 2022 - Development |
Best Compliance Training for Professionals to Stay Ahead of Regulations - Finding the best compliance training is essential for professionals who need to stay current with ever-evolving regulations. Whether you're in HR, payroll, finance, or management, proper training helps protect your organization from costly mistakes and legal risks. Supreme Trainer offers expert-led, online compliance webinars that are practical, up-to-date, and easy to access. From mastering Form […] |
XML_COMPRESSION for existing tables - We are in the process of upgrading to SQL Server 2022 and would like to make use of the XML compression feature it offers, as we have a handful of tables that store considerable amounts of XML data. I suspect the answer is "no", but is there a way to enable XML compression on an […] |
SQL - Conditional merge join - I want to add a condition in the joining columns part of the merge statement like this : Merge dbo.tblDest as target using (select ...) as source on target.EmpID = source.EmpID and target.AwardID = source.AwardID --this second condition I want to add only if the source.AwardID is not null. How to do that pls advise. […] |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. webmaster@sqlservercentral.com |