Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Site Related Forums
 The Yak Corral
 LINQ vs SQL

Author  Topic 

Sachin.Nand

2937 Posts

Posted - 2010-10-18 : 05:31:35

Is LINQ totally going to replace SQL in say 5 years?

What do you guys think??

PBUH

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2010-10-18 : 07:23:18
not even close. the sql crap that Linq generates is not really optimal.
plus Linq2Sql is not being developed actively anymore. it's EF now.
And EF is just an ORM and it we'll see how long those last.

___________________________________________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.9 out!

SQL Server MVP
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-18 : 12:53:19
I am sick of supporting the SQL crap that these types of packages generate. They have caused nothing but headaches from a DBA perspective in production.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-10-18 : 14:18:07
ah...the silver bullet...seen them for many (too many) years....all things to all people...never works

I mean...who really drinks coors light???

Denver fans?

Thank you san diego

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx





Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2010-10-19 : 10:42:07
quote:
Originally posted by tkizer
I am sick of supporting the SQL crap that these types of packages generate. They have caused nothing but headaches from a DBA perspective in production...


I don't disagree with that, but I'm also sick of supporting all the crap SQL generated by incompetent developers.








CODO ERGO SUM
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-19 : 12:25:08
Yeah that too!

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2010-10-19 : 16:01:14
so LINQ is a reaplacement for crappy devs?


elsasoft.org
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2010-10-19 : 16:16:19
quote:
Originally posted by jezemine

so LINQ is a reaplacement for crappy devs?


elsasoft.org



No, it just helps them create crap SQL much faster, so they can go back to generating crap C#, VB, C++, Java, ASP, etc.




CODO ERGO SUM
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-19 : 18:30:24
I love these comments.

Hibernate is the one that is in use by the Java developers I work with. You should see how complex-looking it makes the queries for just a simple query. One of the problems that I have with Hibernate is that it doesn't give transaction control to the developer. If they'd use stored procedures, then we could control it. However, with the prepared statements and Hibernate, the transaction code is in a layer that the developers have no control over. I bring this up because we have a few applications that are leaving transactions open, and it appears to be a Hibernate bug.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2010-10-19 : 20:03:11
i know nothing about Hibernate but NHibernate which is a .Net port of Hibernate handles all this pretty well.
Has the UnitOfWork pattern immplemented quite well and any queries that are horrible are usually to devs not knowing
better and introducing SELECT N+1 problems.

___________________________________________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.9 out!

SQL Server MVP
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-19 : 20:05:07
The horrible queries that Hibernate generates aren't exactly horrible, they are just hard to read. The software aliases everything.

Here's a fake example:
select column1 as column1_10_8_4_6, column2 as column2_8_9_1, ...
from table1 as table1_5_3_2
where ...

It makes it so hard to read! I have to spend a few minutes rewriting it just so that I can analyze it.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-10-20 : 10:36:59
ALL control (and business logic) MUST remain at the database layer

Front ends developemnt tools are merely art



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx





Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-10-20 : 12:17:33
I've never seen a code generator that doesn't generate garbage. Including SSMS (I posted an article a couple years ago on one in particular).

I'll take the 1st query below (written by me) over the 2nd one (generated by SSMS) every time.

-- A silly simple view --

Create View View_1
AS

SELECT j.name, j.description, s.step_name, s.command
FROM sysjobs j
JOIN sysjobsteps s
On s.job_id = j.job_id
And s.step_id = j.start_step_id
WHERE j.enabled = 1;
GO



-- same view from ssms --
CREATE VIEW [dbo].[View_1]
AS
SELECT dbo.sysjobs.name, dbo.sysjobs.description, dbo.sysjobsteps.step_name, dbo.sysjobsteps.command, dbo.sysjobs.enabled
FROM dbo.sysjobs INNER JOIN
dbo.sysjobsteps ON dbo.sysjobs.job_id = dbo.sysjobsteps.job_id AND dbo.sysjobs.start_step_id = dbo.sysjobsteps.step_id
WHERE (dbo.sysjobs.enabled = 1)

GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties =
Begin PaneConfigurations =
Begin PaneConfiguration = 0
NumPanes = 4
Configuration = "(H (1[40] 4[20] 2[20] 3) )"
End
Begin PaneConfiguration = 1
NumPanes = 3
Configuration = "(H (1 [50] 4 [25] 3))"
End
Begin PaneConfiguration = 2
NumPanes = 3
Configuration = "(H (1[50] 2[25] 3) )"
End
Begin PaneConfiguration = 3
NumPanes = 3
Configuration = "(H (4 [30] 2 [40] 3))"
End
Begin PaneConfiguration = 4
NumPanes = 2
Configuration = "(H (1 [56] 3))"
End
Begin PaneConfiguration = 5
NumPanes = 2
Configuration = "(H (2 [66] 3))"
End
Begin PaneConfiguration = 6
NumPanes = 2
Configuration = "(H (4 [50] 3))"
End
Begin PaneConfiguration = 7
NumPanes = 1
Configuration = "(V (3))"
End
Begin PaneConfiguration = 8
NumPanes = 3
Configuration = "(H (1[56] 4[18] 2) )"
End
Begin PaneConfiguration = 9
NumPanes = 2
Configuration = "(H (1 [75] 4))"
End
Begin PaneConfiguration = 10
NumPanes = 2
Configuration = "(H (1[66] 2) )"
End
Begin PaneConfiguration = 11
NumPanes = 2
Configuration = "(H (4 [60] 2))"
End
Begin PaneConfiguration = 12
NumPanes = 1
Configuration = "(H (1) )"
End
Begin PaneConfiguration = 13
NumPanes = 1
Configuration = "(V (4))"
End
Begin PaneConfiguration = 14
NumPanes = 1
Configuration = "(V (2))"
End
ActivePaneConfig = 0
End
Begin DiagramPane =
Begin Origin =
Top = 0
Left = 0
End
Begin Tables =
Begin Table = "sysjobs"
Begin Extent =
Top = 6
Left = 38
Bottom = 289
Right = 254
End
DisplayFlags = 280
TopColumn = 1
End
Begin Table = "sysjobsteps"
Begin Extent =
Top = 6
Left = 292
Bottom = 302
Right = 487
End
DisplayFlags = 280
TopColumn = 0
End
End
End
Begin SQLPane =
End
Begin DataPane =
Begin ParameterDefaults = ""
End
End
Begin CriteriaPane =
Begin ColumnWidths = 11
Column = 1440
Alias = 900
Table = 1170
Output = 720
Append = 1400
NewValue = 1170
SortType = 1350
SortOrder = 1410
GroupBy = 1350
Filter = 1350
Or = 1350
Or = 1350
Or = 1350
End
End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'View_1'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'View_1'
GO
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2010-10-20 : 13:42:05
Did SSMS just decide on it's own to add the dbo.sysjobs.enabled column to the view?




CODO ERGO SUM
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-10-20 : 13:45:17
But one of the biggest advantage I can see is one doesn't have to learn vendor specific flavors of SQL which surely is a great boon.

PBUH

Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-10-20 : 14:29:09
Michael, yes, because I wanted it as part of the WHERE clause. Of course, I never use the GUI so maybe there was a way to exclude it...not sure.

PBUH, true, but developers should learn them anyway. Probably the biggest difference between an average developer and a really good one is their SQL knowledge (assuming they are already pretty good with their programming languages).
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-10-20 : 14:30:01
quote:
But one of the biggest advantage I can see is one doesn't have to learn vendor specific flavors of SQL which surely is a great boon.
Right, which means it writes them all equally badly.
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-10-20 : 14:44:21
quote:
Originally posted by robvolk

quote:
But one of the biggest advantage I can see is one doesn't have to learn vendor specific flavors of SQL which surely is a great boon.
Right, which means it writes them all equally badly.


yep. i know of one generator, that doesn't do BIT data types. it implements outer joins as while loops. it adds tablocks to update statements. but it can work with Oracle, MSSQL, DB2, MySQL, PostGres...it can generate C#, Java, PHP, and others.

garbage.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-10-20 : 23:19:55
quote:
Originally posted by Sachin.Nand

But one of the biggest advantage I can see is one doesn't have to learn vendor specific flavors of SQL which surely is a great boon.

PBUH





Come again?

That's one of the BIG disadvantages

if I hear another consultant the tells me they know how to be a dba because they use a gui...I'm gonna go postal

Go San Fransisco


Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx





Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-10-21 : 00:35:13
quote:
Originally posted by robvolk

quote:
But one of the biggest advantage I can see is one doesn't have to learn vendor specific flavors of SQL which surely is a great boon.
Right, which means it writes them all equally badly.



Come on I am not advocating here for LINQ.Any new product Microsoft comes up with is always Garbage.
But as the time goes by you start seeing its advantages.I think Microsoft is putting lot of effort into it.
That's the reason I said at the first that in 5 years it will replace SQL and the position of a "Developer DBA' will soon be gone.

PBUH

Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2010-10-21 : 05:35:37
we have to make a clear distinction between Linq as a langugae implementation of lambdas in C#
vs
Linq2SQL, an ORM which uses that implementation to access DB.

Linq is AWESOME! i use it all the time instead of for loops, etc.
Linq2SQL is just another sql mapper that is not being developed anymore and is nothing special.

___________________________________________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.9 out!

SQL Server MVP
Go to Top of Page
    Next Page

- Advertisement -