Viewing 15 posts - 4,831 through 4,845 (of 5,394 total)
I coded a tool to track dependencies between code and database. It comes vey handy when you have your house keeping to do, but it's even more useful when you...
September 17, 2009 at 8:27 am
I wonder why you call "football" a sport where the ball can't be touched with feet...
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
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...
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...
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...
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 =...
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...
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
September 16, 2009 at 2:26 am
It looks like I found one:
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
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!
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:
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...
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...
September 14, 2009 at 4:26 am
Viewing 15 posts - 4,831 through 4,845 (of 5,394 total)