Implicit conversion

SQL Server में डेटा मैनिपुलेट करने के लिए फ़ंक्शंस

Ana Voicu

Data Engineer

Data comparison

ध्यान रखें: दो मानों की तुलना के लिए उनका टाइप एक जैसा होना चाहिए.

वरना:

  • SQL Server एक टाइप से दूसरे में बदल देता है (IMPLICIT)
  • डेवलपर डेटा को खुद बदलता है (EXPLICIT)
SQL Server में डेटा मैनिपुलेट करने के लिए फ़ंक्शंस

Example of possible conversions

SELECT 
    company
    bean_type,
    cocoa_percent
FROM ratings;
SQL Server में डेटा मैनिपुलेट करने के लिए फ़ंक्शंस

Example of possible conversions

SELECT 
    company
    bean_type,
    cocoa_percent
FROM ratings
WHERE cocoa_percent > 0.5; 

| company | bean_type  | cocoa_percent |
|---------|------------|---------------|
| Amedei  | Blend      | 0.7000        |
| Bonnat  | Trinitario | 0.7500        |
| ...     | ...        | ...           |
SQL Server में डेटा मैनिपुलेट करने के लिए फ़ंक्शंस

Example of possible conversions

SELECT 
    company
    bean_type,
    cocoa_percent
FROM ratings
WHERE cocoa_percent > -2; 

| company | bean_type  | cocoa_percent |
|---------|------------|---------------|
| Amedei  | Blend      | 0.7000        |
| Bonnat  | Trinitario | 0.7500        |
| ...     | ...        | ...           |
SQL Server में डेटा मैनिपुलेट करने के लिए फ़ंक्शंस

Example of possible conversions

SELECT 
    company
    bean_type,
    cocoa_percent
FROM ratings
WHERE cocoa_percent > GETDATE();

| company | bean_type  | cocoa_percent |
|---------|------------|---------------|
| ...     | ...        | ...           |
SQL Server में डेटा मैनिपुलेट करने के लिए फ़ंक्शंस

Example of possible conversions

SELECT 
    company
    bean_type,
    cocoa_percent
FROM ratings
WHERE cocoa_percent > 'A';


| result                                         | 
|------------------------------------------------|
| Error converting data type varchar to numeric. |
SQL Server में डेटा मैनिपुलेट करने के लिए फ़ंक्शंस

Example of possible conversions

SELECT 
    company
    bean_type,
    cocoa_percent
FROM ratings
WHERE cocoa_percent > '0.5';
| company | bean_type  | cocoa_percent |
|---------|------------|---------------|
| Amedei  | Blend      | 0.7000        |
| Bonnat  | Trinitario | 0.7500        |
| ...     | ...        | ...           |
SQL Server में डेटा मैनिपुलेट करने के लिए फ़ंक्शंस

Data type precedence

डेटा टाइप प्राथमिकता

SQL Server में डेटा मैनिपुलेट करने के लिए फ़ंक्शंस

Data type precedence

SQL Server में डेटा मैनिपुलेट करने के लिए फ़ंक्शंस

Implicit conversion between data types

इम्प्लिसिट कन्वर्शन तालिका

SQL Server में डेटा मैनिपुलेट करने के लिए फ़ंक्शंस

Performance impact of implicit conversion

  • इम्प्लिसिट कन्वर्शन क्वेरी की हर पंक्ति पर होता है।
  • अच्छा डेटाबेस स्कीमा डिज़ाइन इसे रोक सकता है।
SQL Server में डेटा मैनिपुलेट करने के लिए फ़ंक्शंस

अभ्यास करते हैं!

SQL Server में डेटा मैनिपुलेट करने के लिए फ़ंक्शंस

Preparing Video For Download...