Viewing 15 posts - 4,831 through 4,845 (of 5,393 total)
I wonder why you call "football" a sport where the ball can't be touched with feet...
-- Gianluca Sartori
September 16, 2009 at 9:46 am
Place an alias after the last closing parenthesis:
SELECT whatever
FROM (
... lots of code here
) AS src_query
-- Gianluca Sartori
September 16, 2009 at 8:46 am
The plans are different because sysobjects is already ordered by id (it's the clustered index for the table).
In the second query the expression in the order by is the whole...
-- Gianluca Sartori
September 16, 2009 at 8:30 am
There's a ugly hack for this, but you must be ABSOLUTELY sure the procedure doesn't invole any kind of data modification. In other words, the procedure must contain SELECT statements...
-- Gianluca Sartori
September 16, 2009 at 8:21 am
Gianluca Sartori (9/16/2009)
It looks like I found one:
Jonathan (9/15/2009)
I hope you someday learn enough to be embarassed if you reread your posts.
Bob, looks like you found a new friend! 😛
It's...
-- Gianluca Sartori
September 16, 2009 at 8:00 am
You can change the code this way, just replace the FirstTable/SecondTable with your table names:
-- These variables could be your SP parameters:
DECLARE @StartDate datetime
DECLARE @EndDate datetime
DECLARE @CustomerName nvarchar(100)
SET @StartDate =...
-- Gianluca Sartori
September 16, 2009 at 6:25 am
Thank you for providing the test data, really well done!
This should work for you:
DECLARE @pivot nvarchar(500)
SET @pivot = ''
SELECT @pivot = @pivot + '[' + Month + '], '
FROM (
SELECT...
-- Gianluca Sartori
September 16, 2009 at 4:28 am
Looks like you need some PIVOT:
http://msdn.microsoft.com/en-us/library/ms177410.aspx
If you post DDL and sample data fro your table I can help you writing the query.
Read this article on how posting sample data:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Regards
Gianluca
-- Gianluca Sartori
September 16, 2009 at 2:26 am
It looks like I found one:
http://www.sqlservercentral.com/Forums/FindPost788254.aspx
-- Gianluca Sartori
September 16, 2009 at 1:58 am
There a wonderful article on Erland Sommarskog's blog that could shed some light:
http://www.sommarskog.se/dyn-search-2005.html
Take the time to read it, you will not repent.
Hope this helps
Gianluca
-- Gianluca Sartori
September 16, 2009 at 1:29 am
I can point you to these free tools:
http://www.codeplex.com/OpenDBiff
http://www.sqleffects.com/Articles/Product/sqlAccordInfo/aboutSqlAccordCommunityEd.html
http://weblogs.sqlteam.com/mladenp/archive/2007/08/10/60279.aspx
but I have tried none of them.
Good luck!
-- Gianluca Sartori
September 15, 2009 at 3:24 am
You would need a book for that, not a forum question.
There are lots of articles around, some here at SSC. You could start from google:
http://www.google.com/search?q=sql+server+2005+indexing
-- Gianluca Sartori
September 15, 2009 at 2:25 am
Really interesting one, Paul.
I didn't know that the engine ignores the changes to the db state.
I'm just wondering why you seem to know the topic so deeply: maybe you got...
-- Gianluca Sartori
September 14, 2009 at 4:34 am
Rob Fisk (9/14/2009)
Specify the columns you need and schema bind where possible and appropriate. When requirements change, so does the code.
I can't think of a case where it is sensible...
-- Gianluca Sartori
September 14, 2009 at 4:26 am
srikant maurya (9/14/2009)
Looking for spcefic reason not alternate solution
Probably you're not looking for advice either, but let me give you some: don't be so abrupt when replying to those who...
-- Gianluca Sartori
September 14, 2009 at 2:59 am
Viewing 15 posts - 4,831 through 4,845 (of 5,393 total)