SQL Server 2005 introduced the new DMV views. They are great and a real improvement to debug and optimize queries.
I find sys.dm_db_index_physical_stats very useful and often write this type of code
Read more →
http://blogs.technet.com/dataplatforminsider/archive/2008/04/15/sql-server-2005-sp3-coming-soon.aspx
Read more →
Find it here here http://support.microsoft.com/default.aspx/kb/949095/
Read more →
Soon available here http://support.microsoft.com/default.aspx/kb/949095/
Legacy Comments
Carlos Eduardo Teixeira de Morae
2008-04-24
re: Cumulative update package 7 for SQL Server 2005 Service Pack 2 i´m need it!
Read more →
This is an updated version for SQL 2005 and later to search all code for a specific keyword SELECT p.RoutineName, 'EXEC sp_helptext ' + QUOTENAME(p.RoutineName) AS [Exec] FROM ( SELECT OBJECT_NAME(so.
Read more →
I just helped a guy here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=98346 with schema and thought that someone could benefit from this code
exec
sp_MSforeachtable"PRINT '? modify'; ALTER SCHEMA new_schema TRANSFER ?; IF @@ERROR = 0 PRINT '?
Read more →
I worked with this topic recent weekend and posted the final functions here http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=97454 The general idea is to have a generic purge functionality.
Legacy Comments
Jason
2008-02-16
re: Finding table reference levels and simulating cascading deletes I understand why some people might want this, but I think it is truly a bad idea to even do something like this.
Read more →
After a good nights sleep when almost all pieces fit together here weblogs.sqlteam.com/peterl/archive/2008/02/06/Curiosity-found.aspx
I realized this morning that this behaviour also explains why there are gaps in identity sequences when inserting a record that violates a contraint.
Read more →
In this topic http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926I gave a suggestion how to get a more detailed error message when working with OPENROWSET.
But the same thinking is applicable for LINKED SERVER and other "outer referenced" data retreival methods.
Read more →
Let’s play with the new OUTPUT operator!<o:p></o:p>
-- Setup TableA & TableB
CREATETABLE#TableA
(
i INT
)
CREATETABLE#TableB
(
i INT
)
CREATETABLE#TableC
Read more →
I was involved in a discussion today about the ISNUMERIC() function Someone proposed a nested solution like this
SELECT Column_Name from ( SELECT Column_Name FROM ( select 'staff' as Column_Name union all select '234000' as Column_Name union all select '12d1' as Column_Name union all select '45e0' as Column_Name union all select '$123.
Read more →
I came across this solution for some months ago on another forum. It is very handy, so I thought i should share it.
CREATE TABLE myTable(Document varbinary(max)) INSERT INTO myTable(Document) SELECT * FROM OPENROWSET(BULK N'C:\Image1.
Read more →