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
 General SQL Server Forums
 New to SQL Server Programming
 SQL Query Review

Author  Topic 

coxmg
Starting Member

16 Posts

Posted - 2010-11-05 : 16:39:57
Are there any experts online who could review my SQL code in a private message? I'd rather not post it publicly. I want to make sure this code is efficient as possible.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-11-05 : 17:31:21
We offer free help on this site. Private help is another matter.

You can change the table names, column names, etc... to hide your schema. You can also create a new account here and post the query under that one so that you are shielded from your name being attached with it.

Any time I've asked a question here, I've gone to great lengths to hide my company's proprietary information. It takes a bit of work on my side, but I'm able to get an answer to my question, which is all that matters.

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

Subscribe to my blog
Go to Top of Page

coxmg
Starting Member

16 Posts

Posted - 2010-11-05 : 19:46:12
quote:
Originally posted by coxmg

Are there any experts online who could review my SQL code in a private message? I'd rather not post it publicly. I want to make sure this code is efficient as possible.



Tell me, does this sequence of queries/views look efficient? I broke it up into various sections to make it easier to understand.

Thanks!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-11-05 : 19:57:08
The queries look fine. Whether or not they are efficient would be based upon the query statistics.

Add these to your query to check for efficiency:
set statistics io on
set statistics time on

Also check the execution plans. Look for missing indexes, scans, high reads, high CPU, etc...

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

Subscribe to my blog
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-11-08 : 07:40:35
What series of views?

--
Gail Shaw
SQL Server MVP
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-11-08 : 12:12:17
He posted it momentarily and then deleted them after my reply. This means that no one else can help, and I didn't save the queries. It's too bad I didn't quote 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

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-11-08 : 12:21:02
Ah. Fine by me, other people to help, other things to do...

Seems to be the week for people to make it hard to answer their questions.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -