FabulousCode Blog
Showing posts with label Using SQL Server. Show all posts
Showing posts with label Using SQL Server. Show all posts

Wednesday, May 13, 2026

Download ODBC Driver for SQL Server

May 13, 2026 0
Download ODBC Driver for SQL Server

 




Applies to:  SQL Server  Azure SQL Database  Azure SQL Managed Instance  Azure Synapse Analytics  Analytics Platform System (PDW)  SQL analytics endpoint in Microsoft Fabric  Warehouse in Microsoft Fabric  SQL database in Microsoft Fabric

Microsoft ODBC Driver for SQL Server is a single dynamic-link library (DLL) containing run-time support for applications using native-code APIs to connect to SQL Server. Use Microsoft ODBC Driver 18 for SQL Server to create new applications or enhance existing applications that need to take advantage of newer SQL Server features.

Prerequisites

Before you install the ODBC driver on Windows, make sure you have the following prerequisites:

  • Visual C++ Redistributable: The ODBC Driver for SQL Server requires the Microsoft Visual C++ Redistributable. If this component isn't already installed on your system, download and install it before installing the ODBC driver. Download the version that matches your system architecture (x64, x86, or ARM64) from Microsoft Visual C++ Redistributable latest supported downloads.

 Note

Most Windows systems already have the Visual C++ Redistributable installed. If the ODBC driver installation fails or the driver doesn't load correctly, verify that the Visual C++ Redistributable is installed on your system.

Linux and macOS don't require this component. For Linux and macOS prerequisites, see the installation guides linked in the Download for Linux and macOS section.

Download for Windows

The redistributable installer for Microsoft ODBC Driver 18 for SQL Server installs the client components, which are required during run time to take advantage of newer SQL Server features. It optionally installs the header files needed to develop an application that uses the ODBC API. Starting with version 17.4.2, the installer also includes and installs the Microsoft Active Directory Authentication Library (ADAL.dll).

Version 18.6.2.1 is the latest general availability (GA) version. If you have a previous version of Microsoft ODBC Driver 18 for SQL Server installed, installing 18.6.2.1 upgrades it to 18.6.2.1. The Microsoft ODBC Driver 18 for SQL Server can be installed side by side with Microsoft ODBC Driver 17 for SQL Server.

 Download Microsoft ODBC Driver 18 for SQL Server (x64)
 Download Microsoft ODBC Driver 18 for SQL Server (x86)
 Download Microsoft ODBC Driver 18 for SQL Server (ARM64)

 Note

Use the x86 installer on 32-bit machines, the x64 installer on x64 machines, or the arm64 installer on ARM64 machines. The x64 and arm64 installers install both 64-bit and 32-bit drivers.

Version information

  • Release number: 18.6.2.1
  • Released: March 31, 2026

 Note

If you're accessing this page from a non-English language version, and want to see the most up-to-date content, select Read in English at the top of this page. You can download different languages from the US-English version site by selecting available languages.




Friday, January 14, 2022

select all columns from first table and only one column from second table on inner join

January 14, 2022 0
select all columns from first table and only one column from second table on inner join



 https://stackoverflow.com/questions/14000572/better-way-to-select-all-columns-from-first-table-and-only-one-column-from-secon



SELECT  tb1.*, tb2.x
FROM    tableA tb1
        INNER JOIN tableB tb2
            ON tb1.a = tb2.a

Tuesday, January 4, 2022

Date and Time Conversions Using SQL Server

January 04, 2022 0
Date and Time Conversions Using SQL Server

 


select convert(varchar, getdate(), 1) mm/dd/yy 12/30/06

select convert(varchar, getdate(), 2) yy.mm.dd 06.12.30

select convert(varchar, getdate(), 3) dd/mm/yy 30/12/06

select convert(varchar, getdate(), 4) dd.mm.yy 30.12.06

select convert(varchar, getdate(), 5) dd-mm-yy 30-12-06

select convert(varchar, getdate(), 6) dd-Mon-yy 30 Dec 06

select convert(varchar, getdate(), 7) Mon dd, yy Dec 30, 06

select convert(varchar, getdate(), 10) mm-dd-yy 12-30-06

select convert(varchar, getdate(), 11) yy/mm/dd 06/12/30

select convert(varchar, getdate(), 12) yymmdd 061230

select convert(varchar, getdate(), 23) yyyy-mm-dd 2006-12-30

select convert(varchar, getdate(), 101) mm/dd/yyyy 12/30/2006

select convert(varchar, getdate(), 102) yyyy.mm.dd 2006.12.30

select convert(varchar, getdate(), 103) dd/mm/yyyy 30/12/2006

select convert(varchar, getdate(), 104) dd.mm.yyyy 30.12.2006

select convert(varchar, getdate(), 105) dd-mm-yyyy 30-12-2006

select convert(varchar, getdate(), 106) dd Mon yyyy 30 Dec 2006

select convert(varchar, getdate(), 107) Mon dd, yyyy Dec 30, 2006

select convert(varchar, getdate(), 110) mm-dd-yyyy 12-30-2006

select convert(varchar, getdate(), 111) yyyy/mm/dd 2006/12/30

select convert(varchar, getdate(), 112) yyyymmdd 20061230

TIME ONLY FORMATS

8 select convert(varchar, getdate(), 8) hh:mm:ss 00:38:54

14 select convert(varchar, getdate(), 14) hh:mm:ss:nnn 00:38:54:840

24 select convert(varchar, getdate(), 24) hh:mm:ss 00:38:54

108 select convert(varchar, getdate(), 108) hh:mm:ss 00:38:54

114 select convert(varchar, getdate(), 114) hh:mm:ss:nnn 00:38:54:840

DATE & TIME FORMATS

0 select convert(varchar, getdate(), 0) Mon dd yyyy hh:mm AM/PM Dec 30 2006 12:38AM

9 select convert(varchar, getdate(), 9) Mon dd yyyy hh:mm:ss:nnn AM/PM Dec 30 2006 12:38:54:840AM

13 select convert(varchar, getdate(), 13) dd Mon yyyy hh:mm:ss:nnn AM/PM 30 Dec 2006 00:38:54:840AM

20 select convert(varchar, getdate(), 20) yyyy-mm-dd hh:mm:ss 2006-12-30 00:38:54

21 select convert(varchar, getdate(), 21) yyyy-mm-dd hh:mm:ss:nnn 2006-12-30 00:38:54.840

22 select convert(varchar, getdate(), 22) mm/dd/yy hh:mm:ss AM/PM 12/30/06 12:38:54 AM

25 select convert(varchar, getdate(), 25) yyyy-mm-dd hh:mm:ss:nnn 2006-12-30 00:38:54.840

100 select convert(varchar, getdate(), 100) Mon dd yyyy hh:mm AM/PM Dec 30 2006 12:38AM

109 select convert(varchar, getdate(), 109) Mon dd yyyy hh:mm:ss:nnn AM/PM Dec 30 2006 12:38:54:840AM

113 select convert(varchar, getdate(), 113) dd Mon yyyy hh:mm:ss:nnn 30 Dec 2006 00:38:54:840

120 select convert(varchar, getdate(), 120) yyyy-mm-dd hh:mm:ss 2006-12-30 00:38:54

121 select convert(varchar, getdate(), 121) yyyy-mm-dd hh:mm:ss:nnn 2006-12-30 00:38:54.840

126 select convert(varchar, getdate(), 126) yyyy-mm-dd T hh:mm:ss:nnn 2006-12-30T00:38:54.840

127 select convert(varchar, getdate(), 127) yyyy-mm-dd T hh:mm:ss:nnn 2006-12-30T00:38:54.840

ISLAMIC CALENDAR DATES

130 select convert(nvarchar, getdate(), 130) dd mmm yyyy hh:mi:ss:nnn AM/PM  

131 select convert(nvarchar, getdate(), 131) dd mmm yyyy hh:mi:ss:nnn AM/PM 10/12/1427 12:38:54:840AM

You can also format the date or time without dividing characters, as well as concatenate the date and time string:

Sample statement Format Output

select replace(convert(varchar, getdate(),101),'/','') mmddyyyy 12302006

select replace(convert(varchar, getdate(),101),'/','') + replace(convert(varchar, getdate(),108),':','') mmddyyyyhhmmss 12302006004426