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

Singular or Plural

This editorial was originally published on Dec 8, 2017. It is being republished as Steve as at the PASS Data Community Summit 2023.

There are all sorts of interesting debates that developers will have about programming. One of those I've written about in the past is Spaces v Tabs. There's a lot of discussion about that one, and certainly no share of strong opinions. I'm sure there are plenty of other development paradigms and habits that will create debate, arguments, and perhaps strain some working relationships.

While I'm not looking to upset anyone, I ran across a discussion recently and thought this would make an interesting debate. If you've got an opinion, please share how and why you might choose to follow your convention. Examples are helpful and may enhance the reasons why you go choose to build systems one way or the other.

If you examine any sample databases out there, you will run across tables named like this: Customers, Orders, Cities, etc. You might also find Product, Person, Address as well. If you are paying attention, you might notice that my examples are both singular and plural in their form. There are no shortage of debates on the topic, but I'm wondering what many of you think.

I've tended to build tables with plural nouns in the past, but I think that's because the first few people that taught me did that. As I've read more and listened to others explain their design decisions, I've embraced singular names. After all, the entity being modeled is often a single instance of a type. A Person or a CreditCard, not a series of them, though we could certainly argue the table is a set of people, so use that.

Ultimately I'm not sure that it matters much in any particular application. We certainly have databases that using each convention, and probably a few that use both inside the same schema. I think choosing an entity name that is easy to understand is important, and maybe the idea of singular or plural names matters less. After all, as long as you're not naming tables F42 and H1492, everyone will get used to the convention.

Steve Jones - SSC Editor

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

 
 Featured Contents
SQLServerCentral Article

Scheduling SQL Agent Jobs on Alternating Weeks

Ben Thul from SQLServerCentral

Bi-week... semi-week... fortnight... "every two weeks" Recently on the SQL Community Slack group, someone asked if there was a way to schedule a backup to run on alternate weeks. I'm not exactly sure why (maybe they wanted to run full and differential backups on alternating weeks), but yes, we can do that. In part one […]

External Article

Is your organization using MongoDB? Help the Redgate Flyway team understand your pain points.

Additional Articles from Redgate

Is MongoDB in use within your organization? The Flyway development team is adding MongoDB support into Flyway and would like to better understand the current pain points. If you are able help, or are interested in finding out more, please participate in our 5-minute survey.

External Article

How to get your security team on board with your cloud migration

Additional Articles from Redgate

In this second part of the Q&A with Dustin Dorsey, we asked him about how to get buy-in from security teams who are cautious by nature, how to encourage the wider IT team to accept their recommendations, and what additional challenges highly regulated sectors like healthcare and finance face.

Blog Post

From the SQL Server Central Blogs - Help! My Docker SQL Instance Won’t Start!

hellosqlkitty from SQLKitty

One day, I shut down my computer, as I usually do nightly. This time, I shut it down on a Friday and turned it back on after a holiday...

Blog Post

From the SQL Server Central Blogs - What is Azure SQL

Tim Radney from Tim Radney - Database Professional

I get asked about Azure SQL very often. This is a topic that I’ve written about and taught many times. To be honest, this is a rather large topic...

Pro T-SQL 2022: Toward Speed, Scalability, and Standardization for SQL Server Developers

Site Owners from SQLServerCentral

Learn how to write and design simple and efficient T-SQL code. This is a hands-on book that teaches you how to write better T-SQL with examples and straightforward explanations.

 

 Question of the Day

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

 

Finding Server Roles

I want to query for server roles. I see a DMV for server_principals and server_role_members, but where are the server role names stored?

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)

Checking the Servicves

I am connected to a SQL Server 2022 instance. I want to check on the service account running SQL Agent. How can I do this from T-SQL?

Answer: query sys.dm_server_services

Explanation: The services installed in the instance will be returned by sys.dm_server_services, including the account, last startup, and other information. Ref: sys.dm_server_services - https://learn.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-server-services-transact-sql?view=azuresqldb-current

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
SQL2017 DBMirroring Query store not working on mirrored databases - I have noticed on our SQL2017 mirrored databases Query store is not working. ( Moving to AGs is not an option. ) Settings in use: ALTER DATABASE [MyMirroredDb] SET QUERY_STORE = ON GO ALTER DATABASE [MyMirroredDb] SET QUERY_STORE (OPERATION_MODE = READ_WRITE, CLEANUP_POLICY = (STALE_QUERY_THRESHOLD_DAYS = 30), DATA_FLUSH_INTERVAL_SECONDS = 900, INTERVAL_LENGTH_MINUTES = 60, MAX_STORAGE_SIZE_MB = 100, […]
SQL Server 2016 - Administration
SQL Server Transactional Replication-Snapshot Initialization for existing REPL - Hi,   This is Syed JB, I have an existing Transactional Replication. Unfortunately, for some reasons Replication has been removed for some time.  But, now, we have to rebuild the Transactional Replication. Here is the problem, Subscriber has the historical data and for this I can’t push the snapshot and without the initialization, subscriber subscription […]
SQL 2012 - General
SQL Scripts automatically invoked - When detecting the processes in the SQL Server 2012, I found there was a SQL scrit executed automatically automatically many times, the following as attachment, do you know when the script will be executed and when it will be executed? thanks a lot!
SQL Server 2019 - Administration
Log shipping time_since_last_backup - I am using SQL server 2019, I have a database setup transaction log shipping on Server A, and secondary on Server B. I have a need to setup another database to also use transaction log shipping, also primary db is on ServerA and secondary is on Server B. When I setup the Alert monitor instance […]
SQL replication error. - Hi I´m having two SQL server cluster ( lets say A and B. ) with a number of instances ( lets say A1, A2,.. , B1,B2...)  in two different sites. I want to replicate A\A1 database Test to server B\B1 database Test and server  B\B1 database test2 to server A\A1 database Test2 ( hope […]
Sorry posted in admin section - Sorry posted in admin section.
SQL Server 2019 - Development
Find a word from string - Hi All I would like to get rows wherever it has "restricted" . If I write condition with like '%restricted%' it is showing me all. create table #tbl_datafile_list (Autogrow varchar(500)) go insert into #tbl_datafile_list values ('64.0 MB, unrestricted growth'), ('By 10 percent, restricted growth to 500000.0 MB'), ('By 10 percent, unrestricted growth'), ('1.0 MB, unrestricted […]
Has SQL Server Introduced a way for Converting HTML to non-HTML stored as VARCHA - If a table stores in a column of type VARCHAR the textual equivalent of an html page, does SQL Server have some but in function or process for converting that into non-html text, just regular text with carriage returns and the like? I've seen a few custom solutions for this but noting native to SQL […]
SQL Azure - Administration
IX fragmentation and Updating Stats - Though its Azure MI Business critical , I see fragmentation, Any script to identify which IX's need to be rebuilt ,as Frag is over 50%. I will add REBUILD WITH (ONLINE=ON)  as we cannot have downtime , Its a 24 x 7 DB.  I see failed inserts on dynatrace every now and then, possibly as […]
Good Azure cost calculator - Azure calculator doesn't give a good estimate as it cannot differentiate between HA/ DR and primary replica. I have looked around , I couldn't find a good way to come up with an estimate, wondering how others have done this before?
shrink data file with low priority - so total size of DB on Azure is 1 TB, but when I add all tables ( Data file ) and log file the total size is 100 GB. So I need to reclaim the 900 GB ( release storage to the OS ) . MS recommends running DBCC shrinkfile  with wait at low priority […]
Reporting Services
HSTS - need to enable in SSRS 2022 - Hi, My sys admin says I must enable HSTS in SSRS to pass penetration tests. Using this as guide: Enabling HSTS and selecting most secure ciphers and protocols for HTTPS for ConfigMgr I change the custom header property and restarted the ssrs service. Problem is my sysadmin is saying that is still not passing the HSTS […]
Analysis Services
Product Hierarchy in a Matrix with 8+ measures on Values-- Perfomance - I'm not new to PowerBI, but I'm new to this problem. I'm working for a company that's creating a PowerBI solution on Azure for a retail company.  They have a proper star schema (Sales fact in the middle, and then these dimensions: Product (hierarchy, 8 levels), Date, Store Hierarchy. And then they have like 8 […]
SQL Server 2022 - Administration
None of the IP addresses configured for the availability group listener - Hi , Receiving below error when trying to add listener to AG. Any suggestions please. ALTER AVAILABILITY GROUP xxxx ADD LISTENER N'xxxx' ( WITH IP ( ('xx.xx.xx.xx', 'xxx.xxx.xxx.xxx') ), PORT=1433 );   Error: Msg 19456, Level 16, State 0, Line 1 None of the IP addresses configured for the availability group listener can be hosted […]
SQL Server 2022 - Development
How to Efficiently Find and Remove Duplicates in a Large SQL Database? - I have a large SQL database with millions of records, and I've identified duplicate entries. What's the most efficient way to find and remove these duplicates without compromising database performance or data integrity? Are there any best practices or SQL queries that can help in this situation?" This question addresses a common database maintenance task […]
 

 

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

 

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