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

Daily Coping Tip

Do something small, but different today to make yourself smile.

I also have a thread at SQLServerCentral dealing with coping mechanisms and resources. Feel free to participate.

For many of you out there working in a new way, I'm including a thought of the day on how to cope in this challenging time from The Action for Happiness Coping Calendar. My items will be on my blog, feel free to share yours.

Developer Optimism

Developers, in general, are very optimistic about the code they write. This is likely one cause of their estimates of the time required being low, as well as the various bugs that slip through because of corner cases that appear for the problem being solved. Often developers think they've considered the various ways this code ought to work and covered all the possibilities.

They often also feel that their code is superior to others, and that they can examine a problem in a new way. One of the reasons that I think many developers want to rewrite systems in some new technology or new way, embracing the Not-Invented-Here way of looking at other people's code.

Of course, many developers these days don't eschew all code from others. Usually, it's just other people in their organization, as a developer will embrace some random open source project they've discovered, sure that using this library/language/whatever will make their code better.

While I do think there are examples of some new tech that is better than what's around, I don't know that any of them are a panacea. While F# is praised in many circles as better than C#, it's not widely used, at least according to surveys of the top programming languages in use (IEEE, SO).

What is widely used is SQL. In fact, if we look t other database languages, nothing else is close. While I'm sure plenty of those C# and Java programmers use LINQ or some ORM to produce the SQL code, I don't know many competent or highly regarded developers that can't write some SQL code.

There are some interesting ruminations on the optimism of developers in this piece. It made me smile, and I like the practical ending. While you can debate and discuss things, ultimately we need to ship code. And we are almost always better off using a technology we know rather than searching for a perfect new one to solve our problems.

When working with databases, relational or even most of the popular NoSQL ones, this means knowing SQL. And when trying to solve our database problems, in many cases, this means learning to better write SQL and build relational entities, not abandoning our platform for some new shiny one that we think will make everything run smoother.

Steve Jones - SSC Editor

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

 
 Featured Contents
SQLServerCentral Article

SQL Ledger: Protecting Data in Azure SQL

dennes-937980 from SQLServerCentral

Learn how you can set up and use Ledger tables in an Azure SQL Database to verify the integrity of your database changes.

External Article

How to Expand a Range of Dates into Rows with the SQL Server Function GENERATE_SERIES

Additional Articles from MSSQLTips.com

In this tip, we cover how to use the GENERATE_SERIES function to expand a range of dates into rows

External Article

Introducing the MySQL SELECT statement

Additional Articles from SimpleTalk

Use SELECT statements to query a MySQL database. In this article, Robert Sheldon explains how.

From the SQL Server Central Blogs - Thinking about data points and more …

Rayis Imayev from Data Adventures

(2022-Aug-28) Going on a family vacation road trip always fills me with a myriad of happy emotions and expectations to explore new places, see new people and essentially be led...

From the SQL Server Central Blogs - A simple lab to demonstrate the danger of NOLOCKs in INSERT statements

Will Assaf from SQL Tact

The READ UNCOMMITTED isolation level, which the NOLOCK table hint activates, is not to be trusted when it comes to writing data. You are not always protected by error...

 

 Question of the Day

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

 

An Interesting Conversion

What is the result from this code?
SELECT CONVERT(nvarchar,N'123456789012345678901234567890!')

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)

Saving Labor

I have a database with over 100 stored procedures. We want to be sure we capture the text in files for version control. What is the easiest way to get the text of all stored procedures into separate files without spending a lot of time.

Answer: Right click the database, select Tasks, Generate Scripts, and save each procedure to a separate file

Explanation: The easiest way to get over 100 files saved with the stored procedure code is to use the Generate Scripts option in SSMS. This allows you to pick stored procedures and save each to a separate file. Ref: Generate Scripts - https://docs.microsoft.com/en-us/sql/ssms/scripting/generate-scripts-sql-server-management-studio?view=sql-server-ver16

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 2016 - Administration
SQL Multisubnet DNS issue - Hello We have a situation where we need to setup AlwaysOn configuration in hybrid mode (2 servers on on-premises and 2 on Azure hosted hosted under same cluster) with listener having 2 different IP's from 2 different subnets (one IP of Azure subnet and other of on-premises subnet) Since we had application connection issues we […]
non-sysadmins have been denied permission to run cmdexec job steps without a pro - Hello Some of the devleopers need to run xp_cmdshell. These are the steps followed, still have the error as: "non-sysadmins have been denied permission to run cmdexec job steps without a proxy account" Created a windows group account 2. Under credentials, added the account as proxy 3. Under agent jobs, under CmdExec, added the proxy […]
SQL Server 2016 - Development and T-SQL
Finding first record that meets conditions + allowing grouping - Just want to explore the best way to pick the "first" record from a table that meets certain conditions, while at the same time allowing grouping to occur. As one example, consider a "planting" scenario where one needs to know the first month it is safe to plant seeds in different cities.  Assume the temperature […]
Is It Possible to Join a Table-Valued Function w/Param To DB table - If I have a TVF (Table Valued Function) that accepts a date as a parameter I can join it to a Regular DB table if the value passed into the TVF is a fixed date so I can either use GetDate() or I can assign a date to a variable and pass the variable into […]
Modify Trigger to take values from inserted except for 1 field - I am working with a system that has audit trail triggers on most of it's key tables.  On an INSERT/UPDATE/DELETE the audit table records get written with the domain table name and the before and after image using the following generic code if exists (select 1 from inserted) select @myai = CAST((SELECT TOP 1 * […]
Development - SQL Server 2014
Export to Fixed width file - I have an SSIS process that I would like to replace. It imports an Excel file, transforms the data and exports to a text file. I am trying to create a stored procedure that will do the same so I can execute it from an agent job. All of the solutions I have seen do […]
SQL Server 2019 - Administration
SQL user and AD Group - Blank out the "Default Schema" - A previous DBA managed this before me. An application had a requirement to blank out the "Default Schema". See pic. Does anyone know how this was done? Every time I do it in SSMS the default schema reverts back the the previous schema. T-SQL, I couldn't get to do it either.  
SQL Server consolidation - infra and infosec applications - Hi, When I join my current company we had plenty of single porpoise SQL instances and my boss (senior DBA) indicated an consolidation effort... and left company. I am trying to proceed with his plan which was clear at the beginning but I encountered a few applications for which I have serious doubts. I wander […]
Background CREATE INDEX process is blocked by an UPDATE and UPDATE waits - Hi, In one of our projects we are using SQL Server 2019 Enterprise ed. 15.0.4249.2 version and we have synchronous always on high availability in all databases. There we have 5 databases. So, in one database, we have a stored procedure running everyday which includes an update on a table in a different database and […]
SQL Server 2019 - Development
Connect PowerBI to SQL Server - TrustServerCertificate - Hi there, I have a problem with connecting my PowerBI desktop to my SQL server. I know 100% the problem lies with the 'TrustServerCertificate' attribute. When logging into to SSMS, or creating and ODBC data source, I need to ensure TrustServerCertificate is true. However, when using the SQL server connector (and the Azure SQL Server […]
Add another column with some commands - i have a script below to find all the db fixed role db_datawriter. this is working fine, no issues. what i want to do is come up with a series of commands: drop the member from the db grant update, delete, insert to the member So the 5th column will look something like this: USE […]
Joining tables -   I'm a real beginner of SQL and have not managed to solve this. I'm trying to join all the information below. For this I want to use the customer_id whos in table 1 and table 2. The first step will be to join the last_name (table 2) into the new table. In the next […]
SQL Azure - Administration
Can an Azure Public Endpoint access/login be restricted to select Applications? - WARNING: Not an Azure veteran by any means (barely a newbie)  so may ask some very dumb questions We've hired a 3rd party to migrate an on prem SQL Server DB to Azure and develop a cloud based solution to replace the current MS Access based application that has been accessing/using the SQL Server DB.  […]
Azure Data Factory
Azure data factory - Hi all I was wondering if anyone knows where to go for help with azure data factory. I'm trying to use a derived column to create a column from data in another column. The problem is I don't know how to write the expression or where to look for help. The azure documentation isn't clear […]
Reporting Services
Need to migrate on prem SSRS to Azure Managed Instance - Can it possible to migrate the on prem SSRS to Azure Managed Instance ? I can see Hosting catalog databases for all supported versions of SSRS in Azure SQL Managed Instance. But don't think so, work with Managed Instance for SSRS some thing like on prem SSRS. As the reporting services won't be installed / […]
 

 

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

 

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