March 28, 2014 at 9:19 am
GilaMonster (3/28/2014)
Ed Wagner (3/28/2014)
Grant - You have booth babes??? :w00t:Grant *is* the booth 'babe' 🙂
Oh boy - I should have kept my mouth shut. Please, no pictures and nothing about boats.
March 28, 2014 at 9:22 am
Ed Wagner (3/28/2014)
GilaMonster (3/28/2014)
Ed Wagner (3/28/2014)
Grant - You have booth babes??? :w00t:Grant *is* the booth 'babe' 🙂
Oh boy - I should have kept my mouth shut. Please, no pictures and nothing about boats.
Now we have boat babes and booth babes??? SCHWEET!!!
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
March 28, 2014 at 9:29 am
I'm a developer/programmer/moroff/slave and for that reason, I wonder why people like to overcomplicate things if they have the tools available. Next thing, I'll hear about someone making a select for each value in the table to show it on a grid.
March 28, 2014 at 9:37 am
Luis Cazares (3/28/2014)
I'm a developer/programmer/moroff/slave and for that reason, I wonder why people like to overcomplicate things if they have the tools available. Next thing, I'll hear about someone making a select for each value in the table to show it on a grid.
You mean that is wrong? I usually get a dataset with the IDs. The for each row I call another procedure to loop through the columns. That way I get to maximize the number of queries being run. But it should be faster right because each query is really small. :w00t:
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
March 28, 2014 at 9:43 am
Sean Lange (3/28/2014)
Luis Cazares (3/28/2014)
I'm a developer/programmer/moroff/slave and for that reason, I wonder why people like to overcomplicate things if they have the tools available. Next thing, I'll hear about someone making a select for each value in the table to show it on a grid.You mean that is wrong? I usually get a dataset with the IDs. The for each row I call another procedure to loop through the columns. That way I get to maximize the number of queries being run. But it should be faster right because each query is really small. :w00t:
Of course that's wrong. You need to create a cursor to go through every detail row. Don't forget to use one variable for each field and one for each row.
March 28, 2014 at 9:45 am
Sean Lange (3/28/2014)
Luis Cazares (3/28/2014)
I'm a developer/programmer/moroff/slave and for that reason, I wonder why people like to overcomplicate things if they have the tools available. Next thing, I'll hear about someone making a select for each value in the table to show it on a grid.You mean that is wrong? I usually get a dataset with the IDs. The for each row I call another procedure to loop through the columns. That way I get to maximize the number of queries being run. But it should be faster right because each query is really small. :w00t:
This is what the ORM is for 😀
I have seen that for updating 30 objects (two tables) into database, JPA generates 13 000 small queries. They could easily cut this half by doing update instead delete + insert, but still :w00t:
Queries are like
SELECT id FROM TABLEA WHERE (id = ?)
March 28, 2014 at 9:45 am
Luis Cazares (3/28/2014)
Sean Lange (3/28/2014)
Luis Cazares (3/28/2014)
I'm a developer/programmer/moroff/slave and for that reason, I wonder why people like to overcomplicate things if they have the tools available. Next thing, I'll hear about someone making a select for each value in the table to show it on a grid.You mean that is wrong? I usually get a dataset with the IDs. The for each row I call another procedure to loop through the columns. That way I get to maximize the number of queries being run. But it should be faster right because each query is really small. :w00t:
Of course that's wrong. You need to create a cursor to go through every detail row. Don't forget to use one variable for each field and one for each row.
Leave it to you to come with a better approach. I guess my afternoon will be busy now retrofitting my code for worse performance.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
March 28, 2014 at 9:46 am
And above all else, remember: Always nest your cursors at least three levels deep.
Luis Cazares (3/28/2014)
Sean Lange (3/28/2014)
Luis Cazares (3/28/2014)
I'm a developer/programmer/moroff/slave and for that reason, I wonder why people like to overcomplicate things if they have the tools available. Next thing, I'll hear about someone making a select for each value in the table to show it on a grid.You mean that is wrong? I usually get a dataset with the IDs. The for each row I call another procedure to loop through the columns. That way I get to maximize the number of queries being run. But it should be faster right because each query is really small. :w00t:
Of course that's wrong. You need to create a cursor to go through every detail row. Don't forget to use one variable for each field and one for each row.
March 28, 2014 at 9:47 am
Ville-Pekka Vahteala (3/28/2014)
Sean Lange (3/28/2014)
Luis Cazares (3/28/2014)
I'm a developer/programmer/moroff/slave and for that reason, I wonder why people like to overcomplicate things if they have the tools available. Next thing, I'll hear about someone making a select for each value in the table to show it on a grid.You mean that is wrong? I usually get a dataset with the IDs. The for each row I call another procedure to loop through the columns. That way I get to maximize the number of queries being run. But it should be faster right because each query is really small. :w00t:
This is what the ORM is for 😀
I have seen that for updating 30 objects (two tables) into database, JPA generates 13 000 small queries. They could easily cut this half by doing update instead delete + insert, but still :w00t:
Queries are like
SELECT id FROM TABLEA WHERE (id = ?)
LOL. I have seen some seriously nasty stuff coming out of those supposed "faster, better, stronger" ORM "solutions".
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
March 28, 2014 at 10:01 am
Luis Cazares (3/28/2014)
I'm a developer/programmer/moroff/slave and for that reason, I wonder why people like to overcomplicate things if they have the tools available. Next thing, I'll hear about someone making a select for each value in the table to show it on a grid.
I have already seen this done to populate an Excel workbook.
Took about 6 hours to populate, and the developers complained that something was "wrong with the server".
I pointed out that all of the data could be returned in a single result set, but they said they "didn't have time to fix it".
I suggested that they could fix it in less time then it took to populate the workbook, but they never got around to it.
FYI, I think this is the first time I ever posted on The Thread.
March 28, 2014 at 10:05 am
Luis Cazares (3/28/2014)
I'm a developer/programmer/moroff/slave and for that reason, I wonder why people like to overcomplicate things if they have the tools available. Next thing, I'll hear about someone making a select for each value in the table to show it on a grid.
You mean something like this??
USE AdventureWorks2008R2;
GO
SELECT 'SELECT CustomerID,* FROM Sales.Customer where CustomerID = '+CAST(CustomerID as varchar) + ' Union All'
FROM Sales.Customer
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
March 28, 2014 at 10:06 am
Ed Wagner (3/28/2014)
GilaMonster (3/28/2014)
Ed Wagner (3/28/2014)
Grant - You have booth babes??? :w00t:Grant *is* the booth 'babe' 🙂
Oh boy - I should have kept my mouth shut. Please, no pictures and nothing about boats.
That is such a perfect set up that I'm just going to assume it's a trap.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
March 28, 2014 at 10:08 am
Michael Valentine Jones (3/28/2014)
Luis Cazares (3/28/2014)
I'm a developer/programmer/moroff/slave and for that reason, I wonder why people like to overcomplicate things if they have the tools available. Next thing, I'll hear about someone making a select for each value in the table to show it on a grid.I have already seen this done to populate an Excel workbook.
Took about 6 hours to populate, and the developers complained that something was "wrong with the server".
I pointed out that all of the data could be returned in a single result set, but they said they "didn't have time to fix it".
I suggested that they could fix it in less time then it took to populate the workbook, but they never got around to it.
Ummm errrm, what the ....?
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
March 28, 2014 at 10:20 am
Michael Valentine Jones (3/28/2014)
Luis Cazares (3/28/2014)
I'm a developer/programmer/moroff/slave and for that reason, I wonder why people like to overcomplicate things if they have the tools available. Next thing, I'll hear about someone making a select for each value in the table to show it on a grid.I have already seen this done to populate an Excel workbook.
Took about 6 hours to populate, and the developers complained that something was "wrong with the server".
I pointed out that all of the data could be returned in a single result set, but they said they "didn't have time to fix it".
I suggested that they could fix it in less time then it took to populate the workbook, but they never got around to it.
FYI, I think this is the first time I ever posted on The Thread.
Sounds like a classic case of "we want right now, we don't care if it is right".
And welcome to the thread. You have a few pages to read to get caught up. 😉
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
March 28, 2014 at 10:36 am
GilaMonster (3/28/2014)
Ed Wagner (3/28/2014)
Grant - You have booth babes??? :w00t:Grant *is* the booth 'babe' 🙂
Heh... especially on kilt day. 😀
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 15 posts - 43,486 through 43,500 (of 66,738 total)
You must be logged in to reply to this topic. Login to reply