เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Changing the default language

The language set in SQL Server can influence the way character strings are interpreted as dates. Changing the language automatically updates the date format. In this exercise, you will analyze the impact of the SET LANGUAGE command on some practical examples. You will select between the English, Croatian, and Dutch language, taking into account that they use the following formats:

Language Date format
English mdy
Croatian ymd
Dutch dmy

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Functions for Manipulating Data in SQL Server

ดูคอร์ส

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

DECLARE @date1 NVARCHAR(20) = '30.03.2019';

-- Set the correct language
SET LANGUAGE ___;
SELECT
	@date1 AS initial_date,
    -- Check that the date is valid
	ISDATE(@date1) AS is_valid,
    -- Select the name of the month
	___ AS month_name;
แก้ไขและรันโค้ด