Andy M Mallon - AM²

Databases & Diversity — Checking Integrity

  • Home
  • About Andy
  • Stack Exchange Stuff
    • DBA Stack Exchange
    • Stack Overflow
    • Server Fault
    • Super User
  • GitHub Stuff
    • Profile
    • DBA Database
    • Data Blogger Resource Kit
    • Presentation Content
  • Legal Stuff

DBA Stack Exchange

These posts were previously published on the DBA Stack Exchange site, and have been cross-posted here for ad-free posterity. I’m no longer active with responding to questions on the Stack Exchange Network, and consider these to be the canonical links for my answers. If I update any of my responses to correspond to changing technology, they will only be updated on my own site, and not on the Database Administrators Stack Exchange site.

SQL Server 2012 equivalent of AT TIME ZONE capability

June 30, 2021 Andy 0

Question Is there a way in SQL Server 2012 to get what the server time zone would be on a particular date/time? In SQL Server 2016, you have AT TIME ZONE, but that’s not available in 2012. I have a datetimeoffset and I need to … [Read More]

Why does SQL Server convert floats to scientific notation?

June 28, 2021 Andy 0

Question I came across some weird behavior: While passing a float value into a varchar column, the values are getting converted from integers into scientific notation, and it’s that scientific notation that gets stored as a string. results look like this: 1.49559e+006 Scientific notation stored … [Read More]

OLE DB provider “MSOLEDBSQL” with SQL Server not supported?

June 28, 2021 Andy 0

Question I have been using linked server with the old provider (SQLNCLI) without any issue, as recommended by Microsoft, I’m planning to switch to new provider (MSOLEDBSQL). I’m able to add linked server using following T-SQL after installing the drivers Unfortunately, getting following error when … [Read More]

When to partition table in SQL Server based on the amount of memory on server

June 25, 2021 Andy 0

Question I understand that table partitioning is mostly done for data management. I understand that table maintenance becomes more difficult for large tables, since e.g. an index rebuild cannot fit in memory or because e.g. sorts scale with O(n*log(n)) and this causes extra problems with … [Read More]

An expression of non-boolean type specified in a context where a condition is expected, near ‘AND’

June 8, 2021 Andy 0

Question Error message: Msg 4145, Level 15, State 1, Procedure usp_BaseScan_CycleCount_Report, Line 16 An expression of non-boolean type specified in a context where a condition is expected, near ‘AND’. Msg 156, Level 15, State 1, Procedure usp_BaseScan_CycleCount_Report, Line 21 Incorrect syntax near the keyword ‘ELSE’. … [Read More]

SQL Server Configuration – Disabling the “Allow Remote Connections to this Server” Option

June 7, 2021 Andy 0

Question My organization had a security audit and was told that we need to DISABLE the "allow remote connection to this server" option for all of our SQL Servers. What impact would this have on connection to the SQL Server via Management Studio (SSMS) from … [Read More]

How do I preserve leading zeros for varchar field?

May 17, 2021 Andy 0

Question When saving a number with leading zeros into a string variable or column, leading zeros are truncated. When I run this query: The result I get is 11. Is there any way to get 011? asked 2021-05-17 by sandhun p.s Answer In your code … [Read More]

View SQL Code Behind Flat File Import Wizard?

May 10, 2021 Andy 0

Question Is there a way to view and copy the code that the "Import Flat File to SQL" Wizard ultimately uses, after I have gone through all the steps (chosen file, set up data types for my columns, etc.)? While using the Import Flat File … [Read More]

Commit or rollback SQLServer-SQLTransaction when no data changed

May 7, 2021 Andy 0

Question we use the SqlTransaction-class in the backend to access data stored in the MS-SQLServer. In some cases we definitely know that no data were changed by this transaction (and no errors occurred). So the question is: How to close transactions in these cases? Shall … [Read More]

Why is part of transaction committed when stored procedure faults?

April 25, 2021 Andy 0

Question I have a stored procedure that begins by declaring a few variables then contains begin tran; After this it performs some validations on the supplied arguments (and increments an error count each time a supplied argument fails validation). If there is no error count … [Read More]

Posts pagination

« 1 … 4 5 6 … 15 »
github logo Github Profile
DBA Database
Data Blogger Resource Kit
Mastodon Logo Mastodon:
[email protected]
DBA.se profile
My Stack Exchange answers (mirror)

Subscribe via Email

Join 979 other subscribers

SSMS Shortcuts

Awards & Programs



Recent Posts

  • Consuming SQL Agent dates & durations
  • Migrating my Stack Overflow answers to blog posts (Sorry for the spam)
  • Not all stats should be auto-updated
  • T-SQL Tuesday: The last ticket I closed
  • Enforce a specific constraint to be checked first?

Archives

Categories

RSS RSS

  • Consuming SQL Agent dates & durations March 7, 2025
  • Migrating my Stack Overflow answers to blog posts (Sorry for the spam) November 11, 2024
  • Not all stats should be auto-updated August 29, 2024
  • T-SQL Tuesday: The last ticket I closed February 13, 2024
  • Enforce a specific constraint to be checked first? October 7, 2023
  • AG secondary is out of sync for hours after index maintenance February 21, 2023
  • Using OPENJSON, can’t get results to GROUP BY December 24, 2022
  • SQL Modulo Function gives the wrong value? November 18, 2022
  • Is SQL Server affected by OpenSSL 3.0 Vulnerabilities: CVE 2022-3786 and CVE 2022-3602 November 8, 2022
  • What’s the use case of disabling an index? September 25, 2022

Copyright © 2025 | Andy Mallon | am2.co