Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
The Voice of the DBA
 

A Paste Policy

Most of the code I've written for various employers was something that lived inside the organization. This was for internal use and no one outside of the organization ever used it. It was almost always code I'd written, so I wasn't ever worried about the provenance of the code (where it came from).

However, I'm sure I've copied code from somewhere online and used that in some way. I might have taken this function from Jeff Moden and dropped it on a production server where it was used to process a string. I'm sure I've taken code from various places and used it in administrative functions, like Ginger's code to manage a log file.

I don't know that any of those authors would have minded using their code. After all, that's why many of us have written articles and published things at SQL Server Central. We are looking to help others grow their knowledge, as well as provide them short solutions they can incorporate into their own work. I assume most of the people answering questions at SQL Server Central or Stack Overflow feel the same way. Use the code.

In this new age of AI, perhaps that's OK, or perhaps it's not. There is concern about who owns code and who has rights. At Redgate, we build software that's sold and installed on other machines, so we have stricter guidelines. Our policy (in general) is "You MUST NOT include source code of unknown provenance in your application." I saw a note recently that said this also applies to any AI-generated code, even if we provide the prompts.

I doubt many organizations have policies about using code from the Internet, but I wonder if they should. Possibly there might be ownership or usage issues with AI code. If someone posts code on SSC that's one thing, but getting code from an AI that might have been trained (and regurgitates) code that is not freely posted could be a problem.

Maybe it doesn't matter. After all, in your corporate CRUD application or some DBA maintenance script, it's unlikely anyone will be auditing the code for any sort of misuse or copyright infringement.

Steve Jones - SSC Editor

Join the debate, and respond to today's editorial on the forums

 
 Featured Contents
Stairway to DAX and Power BI

Stairway to DAX and Power BI - Level 23: Time Intelligence – Dates Functions: The DAX PREVIOUS() Functions

Bill Pearson from SQLServerCentral

Business Intelligence Architect, Analysis Services Maestro, and author Bill Pearson introduces four very similar DAX Time Intelligence functions related to Date: PREVIOUSDAY(), PREVIOUSMONTH(). PREVIOUSQUARTER() and PREVIOUSYEAR(). He discusses the syntax, uses and operation of each function, and then provides hands-on exposure to it in Power BI.

Technical Article

PASS Data Community Summit

Additional Articles from PASS

Check out the full details for this year's Pre-Cons and Learning Pathways, and find out why some of our speakers are particularly excited for what’s in store this year. If you’re not already on the mailing list, sign up now and be the first to know all Summit 2023 updates.

External Article

The role of forethought for a computer engineer

Additional Articles from SimpleTalk

If you have ever played a game of chess against someone good, or perhaps against a computer, you know that a good player is always thinking multiple moves ahead. Being a DBA and/or a database programmer is like playing several chess games simultaneously.

Blog Post

From the SQL Server Central Blogs - Microsoft Fabric Overview

hellosqlkitty from SQLKitty

First, thank you to Guy in a Cube for a great licensing/cost video. My company is exploring what data warehousing technology to use in Azure. I needed to learn...

Blog Post

From the SQL Server Central Blogs - Reading and searching events inside the SQL Server default trace

SQLPals from Mission: SQL Homeostasis

Note: SQL Trace and SQL Server Profiler are deprecated and will be removed in a future version of Microsoft SQL Server. The replacement technology for them is Extended Events. To Learn More: https://learn.microsoft.com/en-us/sql/relational-databases/sql-trace/sql-trace?view=sql-server-ver16SQL Server...

SQL Server Execution Plans eBook, Third Edition, by Grant Fritchey

SQL Server Execution Plans, Third Edition, by Grant Fritchey

Grant Fritchey from SQLServerCentral

Every Database Administrator, developer, report writer, and anyone else who writes T-SQL to access SQL Server data, must understand how to read and interpret execution plans. This book leads you right from the basics of capturing plans, through how to interrupt them in their various forms, graphical or XML, and then how to use the information you find there to diagnose the most common causes of poor query performance.

 

 Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

Finding Identity Columns

I need to do some maintenance on identity columns in my SQL Server 2019 database. What is the easiest way to find out which tables have identity columns?

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)

Refreshing a View

Which of these can I use to refresh the metadata for a view?

Answer: sp_refreshview or sp_refreshmodule

Explanation: Most people use sp_refreshview to refresh metadata for a view, but you can also use sp_refreshsqlmodule. Ref:

Discuss this question and answer on the forums

 

 

 

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
Log Shipping Jobs stop working automatically - Dear Friends, On my Log Shipping configuration , sometimes , more frequently actually, the Backup,Copy and Restore Jobs stop working automatically.. I have to check on them and run manually...and some times the restore has errors which force me to reconfigure it again..Any comments / advises on this will be highly helpful..Thank you.
SQL Server 2016 - Administration
Continuous lock timeout when trying to exec sp_configure - Hello experts, I'm seeing a strange issue. Yesterday I noticed that I was getting this error when I tried to expand the databases on a dev server: Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc) Lock request time out period exceeded. (Microsoft SQL Server, Error: 1222) I ended up finding a post that suggesting restarting […]
Vulnerability for ODBC driver 13 - ODBC driver 13 has been highlighted as having a vulnerability, and we have been advised to upgrade this to the latest version on our database server running SQL Server 2016 (SP3-GDR). There is apparently no recent version available for version 13. We already have ODBC driver 17.10.4.1 and ODBC driver 18.2.2.1 installed, so we duly […]
SQL Server 2016 - Development and T-SQL
T-SQL to run if in Active Directory Group - So we have a block of code that I only want system account to run.. but if a user is db_owner.. they still need access to run the full proc.. is there a way to check to see if the user is in the correct Active Directory group.. then I can set a flag that […]
Administration - SQL Server 2014
Replication between 2014 and 2022 - Hi, A quick question. The documentation says it is not permitted. But we have configured Peer to Peer and Transactional replication between a SQL 2014 server and a SQL 2022 server. Records are replicated fine, albeit a small test. My question is, "Is this reliable and should it be possible?" Is this related to the […]
SQL Server 2019 - Administration
SSRS Theme Reset In SQL Server standard - We applied a theme to SSRS before a license key was applied. A theme which is not suitable has been set, and unfortuately a standard license key has been applied so i can no longer change the theme. Is am aware that as part of SQL Server Standard you can not set a theme, but […]
[SSIS Server Maintenance Job] failed - Executed as user: ##MS_SSISServerCleanupJobLogin##. The SELECT permission was denied on the object 'availability_databases_cluster', database 'mssqlsystemresource', schema 'sys'. [SQLSTATE 42000] (Error 229). any help with this will be appreciated!
SQL Server 2019 - Development
Understanding creating Partition Key on a date - Hi all, I'm trying to understand partition keys and how to create them.  Did some googling but the samples I found it still doesn't click to me.  So I have a requirement in which my user specifically requests a partition key on a date as this is what will be in the where clause of […]
Use Alpha characters instead of expanding field - We have a situation where back many, many years ago it was decided to merge three columns of data into one column on the DW tables.  The field is currently defined as a CHAR(9).  The first 3 digits represent the risk, next 3 are the location, the final 3 are the building.  So this looks […]
SQL Azure - Administration
Azure SQL VM Patch installation though Automation account , update management - Hi All, Is it possible to apply SQL cummulatative update and OS CU at time by include the KB details in update management.
Analysis Services
Collect data from multiple similar tables and append - PowerQuery/PowerBI - I'm trying to do something similar to using a folder source for data - basically where I specify a folder, and can loop through the contents using PowerQuery and append all the files matching my criteria to a single dataset/table. But the difference is that instead of text files in a folder, I'm looking at […]
Design Ideas and Questions
Thoughts on Database Per Service - Lately we've been asked to create several small databases.  These seemed related.  When we discussed this with the application developers they sent a link (https://microservices.io/patterns/data/database-per-service.html) that talks about individual services having their own database.  The article also talks about schema per service, which is what we are advocating, though there isn't much to be found […]
Administration
Transaction log BU fails in Maintenance Plan fails when there is no Full BU - I have 3 maintenance plans for full backups, differential and transaction log. The job for log backups fails in when there is no full backup. Which is logical of course. But is there a way to prevent this error from happening? I would like an option that it will not try to backup the log […]
SQL Server 2022 - Administration
SQL replication - is there a way to start from current data? - Related to a question I posted a while back... We have a very large inventory database that we replicate from one server to another.  Some of the tables have over 150 million rows.  Recently, we ran into an error that caused replication to fail, and it had to be restarted.  This took a very, very […]
SQL Server 2022 - Development
Standard edition limitations - Hi all, I have not worked in Standard edition in a while (Enterprise only), but a new client of ours only wants Standard edition installed. I know of the main differences between Std and Ent (such as hardware, AO groups, etc.).  But I was mostly wondering if there are any TSQL specific commands / table […]
 

 

RSS FeedTwitter

This email has been sent to {email}. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. This newsletter was sent to you because you signed up at SQLServerCentral.com.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
webmaster@sqlservercentral.com

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -