Tag: SQL Server Internals

  • Get Current Date & Time in SQL Server

    Getting the current date and time in SQL Server is straightforward. Choosing the correct function for your workload is what matters. Whether you’re stamping audit rows, logging ETL runs, or investigating production issues, SQL Server exposes several built-in functions with different precision and return types. All of these functions use the Windows OS clock of…

  • RAND() vs NEWID() in SQL Server

    Most people searching for “random numbers in SQL Server” want one of two things: SQL Server gives you two common tools for this: RAND() and NEWID(). They solve different problems, and confusion usually starts when they are treated as interchangeable. This post shows how to use both, starting with simple examples, and explains why they…

  • DBA Scripts: Get Memory Configuration and Usage

    ,

    🔧Part of the DBA-Tools Project, copy/paste SQL Server scripts and health checks.In: Server & Configuration Max Server Memory is the single most important memory setting on any SQL Server instance, and it’s astonishing how often it’s left unconfigured. Without a cap, SQL Server will happily consume nearly all available RAM for its buffer pool, leaving…