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

Daily Coping Tip

Have a friendly chat with someone you don’t know well

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.

Labor Day 2022

It's Labor Day in the US and I should be away from work. I'm not sure if that's the case as I'm writing this the week before and I've been away on holiday for a week. It's a busy time, so I might be doing a little labor today. Many countries celebrate workers with a holiday at some point during the year, which I like seeing. Workers in industries all over the world produce things and keep our economies moving forward.

If you have the day off, remember there are lots of people who don't. When you encounter service workers today, be extra kind and empathetic. They are still trying to earn a paycheck, and missing out on the celebration.

Steve Jones - SSC Editor

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

 
 Featured Contents
SQLServerCentral Article

The "Numbers" or "Tally" Table: What it is and how it replaces a loop

Jeff Moden from SQLServerCentral.com

Many people have used a "Numbers" or "Tally" table without really knowing what it does. This is an introduction as to how a Tally table replaces a loop.

External Article

Metadata Functions in SQL Server and Their Use Cases

Additional Articles from MSSQLTips.com

Learn about various SQL Server system functions to return meta data from SQL Server such as SERVERPROPERTY, DATABASEPROPERTYEX, DB_NAME, DB_ID, FILE_NAME, FILE_ID, FILE_IDEX, SCHEMA_NAME, SCHEMA_ID, OBJECT_NAME, OBJECT_ID and STATS_DATE.

External Article

Managing Datasets for Database Development Work using Flyway

Additional Articles from Redgate

A generic way of exporting, deleting and loading data, for database development work. It uses Flyway Teams, a PowerShell framework, JSON files for storage and a table manifest to define the correct order of dependency for each task. It should help a team maintain datasets between database versions, as well as to switch between the datasets required to support different types of testing.

Blog Post

From the SQL Server Central Blogs - Log Shipping – Standby Mode

gbargsley from GarryBargsley

Hello, dear blog reader. This week’s blog is coming to you from the home office. Finally, my son is back in school, and the house has some peace. For...

Blog Post

From the SQL Server Central Blogs - Why is security important in a dev environment?

Kenneth.Fisher from SQLStudies

I was asked a rather interesting question during an interview recently. It went something like this: Your resume says you’ve ... Continue reading

 

 Question of the Day

Today's question (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.

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)

DBCC UPDATEUSAGE

What does DBCC UPDATEUSAGE do?

Answer: This updates and reports page and row count inaccuracies in catalog views

Explanation: This command reports and corrects pages and row count inaccuracies in the catalog views. Ref: DBCC UPDATEUSAGE - https://docs.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-updateusage-transact-sql?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

 

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