This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Gouache painting of a wooden card catalog cabinet beside woven baskets of mixed items, linked by a vermilion string.

SQL to MongoDB: Mapping SELECT, WHERE, GROUP BY and JOIN

May 23, 2020
Pinal Dave
SQL Tips and Tricks
Database, MongoDB, NoSQL, SQL Scripts

Moving from SQL to MongoDB is mostly a change of vocabulary plus a new way to join. This post maps SELECT, WHERE, ORDER BY, GROUP BY and JOIN to find, sort, $group and $lookup, and tests each one on a small vegetarian shop.

Read More
Gouache painting of an empty pantry shelf with dust outlines of missing jars, a broom, and one vermilion jar left on the floor.

MongoDB deleteMany: The Empty Filter That Deletes Everything

May 22, 2020
Pinal Dave
SQL Tips and Tricks
Database, MongoDB, NoSQL, SQL Scripts

MongoDB deleteMany removes every document that matches a filter, and an empty filter matches all of them. This post tests deleteOne, deleteMany, findOneAndDelete and the two quiet traps: a misspelled field and a filter built from an unset variable.

Read More
Gouache painting of a wall of small wooden card drawers with one vermilion drawer pulled open and a fresh card among older ones.

MongoDB updateOne: $set, $inc and Upserts Without Surprises

May 21, 2020
Pinal Dave
SQL Tips and Tricks
Database, MongoDB, NoSQL, SQL Scripts

MongoDB updateOne changes one document, and its result object shows how many documents matched and how many changed. This post tests $set, $inc, updateMany, upserts and the replaceOne mistake that wipes every other field.

Read More
Gouache painting of a farm produce stand with crates of vegetables, a brass magnifying glass on one crate and a vermilion basket of chosen tomatoes.

MongoDB find: Filters, Projections and Sorting for SQL People

May 20, 2020
Pinal Dave
SQL Tips and Tricks
Database, MongoDB, NoSQL, SQL Scripts

MongoDB find returns the documents that match a filter. This post tests find, findOne, $gt, $in, $and, $or, projection, sort, limit and countDocuments on 18 grocery products, each next to its SQL equivalent.

Read More
Gouache painting of a brass mail slot beside a tied bundle of envelopes, with one vermilion envelope sticking out at an angle.

MongoDB insertOne and insertMany: Adding Documents the Right Way

May 19, 2020
Pinal Dave
SQL Tips and Tricks
Database, MongoDB, NoSQL, SQL Scripts

MongoDB insertOne adds a document and insertMany adds a list. This post tests both with a unique index, a generated _id and a duplicate key in the middle of a batch, comparing ordered: true with ordered: false and showing what landed.

Read More
Gouache painting of open cardboard folders on a desk holding cards of different shapes, a brass key beside them and one vermilion folder.

Getting Started With mongosh: Databases, Collections and Documents

May 18, 2020
Pinal Dave
SQL Tips and Tricks
Database, MongoDB, NoSQL, SQL Scripts

mongosh is the shell that connects you to MongoDB. This post connects, creates a database and a collection on the first write, and stores a document. It explains the _id, the BSON types and the habits that surprise SQL Server people.

Read More
Grain flowing into a hopper illustrates a measured transfer

How to Know Backup Speed in SQL Server? – Interview Question of the Week #277

May 17, 2020
Pinal Dave
SQL Interview Questions and Answers
SQL Backup and Restore, SQL Scripts, SQL Server

Question: How to Know Backup Speed in SQL Server?

Answer: It is very simple to know the backup speed in SQL Server. Let us discuss today.

Read More
Gouache painting of a row of five wooden doors in a stone wall, four grey and slate and one vermilion

HAS_DBACCESS Function: List the Databases You Can Open

May 16, 2020
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server Security

The HAS_DBACCESS function tells you whether the current login can open a database. One query over sys.databases turns it into a list, and this post tests six databases to show what each zero means: no user, offline, restricted or a busy single user slot.

Read More
Gouache painting of a shelf of cream pots with plants and one differently shaped vermilion pot

Memory-Optimized TempDB Tables: List Them and Check Status

May 15, 2020
Pinal Dave
SQL Performance
In-Memory OLTP, SQL DMV, SQL Memory, SQL TempDB

Memory-optimized TempDB tables are the system tables that SQL Server 2019 and later can keep in memory. This post shows two queries: one that checks whether the feature is on, and one that lists the tables it covers. It also explains the limits that come with the feature.

Read More
Gouache painting of a large orange pumpkin beside a barn door with smaller pumpkins nearby

Metadata Contention in TempDB: When Memory-Optimized Metadata Helps

May 14, 2020
Pinal Dave
SQL Performance
In-Memory OLTP, SQL Memory, SQL TempDB, SQL Wait Stats

Metadata contention in TempDB happens when many sessions create and drop temporary tables at the same moment. This post reads the waits that point to it, explains why RESOURCE_SEMAPHORE is a different problem, and shows how SQL Server 2019 and later can keep that metadata in memory.

Read More
Previous 1 … 76 77 78 79 80 81 82 … 591 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com