I've been using SQL Server to write queries. I was browsing online and I found that python and C# can be used to write query logic as well.
I was wondering is it more efficient to use another programming language instead of SQL for SQL Server?
I've been using SQL Server to write queries. I was browsing online and I found that python and C# can be used to write query logic as well.
I was wondering is it more efficient to use another programming language instead of SQL for SQL Server?
Essentially any logic that happens in a C# or Python program will be sent back to the data layer, simplistically, using SQL queries. For some more complex processing or buisness logic it may be preferable to push this logic up to the business logic layer away from the data layer.
Making changes to SQL is easier that code as in the case of C# or Python a new version with updates to logic etc will require a new version of the software to be shipped. Whereas a DB change can happen behind the scenes.
It depends entirely on what you want to acheive.
SQL Server as of version 2005 offers the SQL CLR - basically a trimmed-down version of the .NET runtime.
This allows you to write .NET code (in C#, VB.NET or any other .NET language) and have this executed within SQL Server.
It's a compelling feature for some scenarios (especially areas where the "native" T-SQL is lacking - string manipulation, regex handling etc.) - but it's often a bit tricky and hard to convince your company's DBA's to enable this feature; DBA's often don't really like the idea of C# code being executed inside their "sacred" database environment...
Read more about the SQL CLR integration here: