Lyra
Learn
AI Learning Platform
π Midnight
π Comfort
π₯ Ember
π Paper
β Contrast
Exams
Sign in to track progress
β Back to the lesson
Module 4 Β· Quiz
"Implicit Conversion: The .NET One"
1. What happens when a C# string is compared to a VARCHAR column in SQL Server?
The comparison is always optimized for a seek.
The VARCHAR column gets converted to NVARCHAR, causing scans.
The C# string is automatically converted to VARCHAR before comparison.
There is no effect on performance.
2. Which method should be used to explicitly specify the parameter type as VARCHAR in ADO.NET?
AddWithValue
AddParameter
Add
AddWithType
3. In Entity Framework Core, how can you prevent a string property from being sent as NVARCHAR by default?
Use .IsUnicode(false) in the mapping.
Set the string length to 0.
Change all strings in the application to char.
No specific changes are needed; it works correctly.
4. What kind of SQL statement can you use to find all VARCHAR/CHAR columns in the database before they become a performance issue?
SELECT * FROM sys.tables
SELECT ... WHERE type = 'VARCHAR'
SELECT ... FROM sys.columns WHERE ty.name IN ('varchar', 'char')
SELECT ... FROM sys.indexes
Submit answers
Continue: "LIKE, SELECT *, and Column Bloat" β
Review this lesson
Retake quiz