Skip to content

Instantly share code, notes, and snippets.

-- create sample data
DROP TABLE IF EXISTS dbo.TABLE_OF_32_INTS;
CREATE TABLE dbo.TABLE_OF_32_INTS (
COL01 INT NULL,
COL02 INT NULL,
// SQL CLR function for converting 32 nullable INTs into a binary string
[SqlFunction(DataAccess = DataAccessKind.Read)]
public static SqlBinary NullableIntsToBinaryInline(
SqlInt32 col01,
SqlInt32 col02,
SqlInt32 col03,
SqlInt32 col04,
SqlInt32 col05,
SqlInt32 col06,
SqlInt32 col07,
--------------------------------------------------------------------------------------------------------------------------------------
-- Data setup
--------------------------------------------------------------------------------------------------------------------------------------
SELECT @@VERSION
--Microsoft SQL Server 2017 (RTM-CU12) (KB4464082) - 14.0.3045.24 (X64)
-- Oct 18 2018 23:11:05
-- Copyright (C) 2017 Microsoft Corporation
-- Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2016 Datacenter 10.0 <X64> (Build 14393: ) (Hypervisor)
-- This error reproduces on SQL Server 2016, 2017, and 2019 CTP
SELECT @@VERSION
--Microsoft SQL Server 2017 (RTM-CU9-GDR) (KB4293805) - 14.0.3035.2 (X64)
-- Jul 6 2018 18:24:36
-- Copyright (C) 2017 Microsoft Corporation
-- Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2016 Datacenter 10.0 <X64> (Build 14393: ) (Hypervisor)
GO
DROP TABLE IF EXISTS #t
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Nummer
072XXXXXX63
072XXXXXX76
07XXXXXX66
072XXXXXX4
-----------------------------------------------------------------------
-- Create test data
-----------------------------------------------------------------------
SELECT @@VERSION
--Microsoft SQL Server 2017 (RTM-CU3-GDR) (KB4052987) - 14.0.3015.40 (X64)
-- Dec 22 2017 16:13:22
-- Copyright (C) 2017 Microsoft Corporation
-- Enterprise Evaluation Edition (64-bit) on Windows Server 2016 Datacenter 10.0 <X64> (Build 14393: ) (Hypervisor)