Site: http://blogs.msdn.com/b/sqltips/ Link: http://blogs.msdn.com/sqltips/rss.xml
by SQL Server Engine Team via SQL Server Engine Tips on 7/3/2008 4:26:00 AM
Converting hexadecimal values to varbinary and vice versa is now easier using the XQuery functionality available from SQL Server 2005. The code samples below show how to perform the conversion(s): -- Convert hexstring value in a variable to varbinary: declare @hexstring varchar(max); set @hexstring = 'abcedf012439'; select cast('' as xml).value('xs:hexBinary( substring(sql:variable("@hexstring"), sql:column("t.pos")) )', 'varbinary(max)') from (select case substring(@he ...
[ read more ]
by SQL Server Engine Team via SQL Server Engine Tips on 7/1/2008 4:25:00 AM
Converting Base64 values to varbinary and vice versa is now easier using the XQuery functionality available from SQL Server 2005 onwards. The code samples below show how to perform the conversion: -- Convert Base64 value in a variable to varbinary: declare @str varchar(20); set @str = '3qAAAA=='; select cast(N'' as xml).value('xs:base64Binary(sql:variable("@str"))', 'varbinary(20)'); -- Convert binary value in a variable to Base64: declare @bin varbinary(20); set @bin = 0xDEA000 ...
by SQL Server Engine Team via SQL Server Engine Tips on 6/27/2008 6:55:00 AM
I came across a question in the SQL Server MVP newsgroup recently about ISNULL and COALESCE usage. COALESCE basically translates to CASE expression and ISNULL is a built-in implemented in the database engine. Both ISNULL and COALESCE can be used to get the same results but there are some differences. 1. Data type determination of the resulting expression - ISNULL uses the first parameter type, COALESCE follows the CASE expression rules and returns type of value with highest precedence 2. The NUL ...
by SQL Server Engine Team via SQL Server Engine Tips on 8/30/2007 10:38:11 PM
I came across a question in the relationalserver.performance newsgroup where a customer was wondering about the spools seen in a recursive query execution plan. The query is shown below: USE Northwind;Go WITH EmpChart AS(SELECT EmployeeId, ReportsTo, 1 AS treelevelFROM EmployeesWHERE (Employees.ReportsTo = 2)UNION ALLSELECT e.EmployeeId, e.ReportsTo, treelevel +1FROM Employees eJOIN EmpChart ecON e.ReportsTo=ec.EmployeeID)SELECT * FROM EmpChart; The plan for the above query shows an index spool ...
by SQL Server Engine Team via SQL Server Engine Tips on 4/12/2007 12:21:16 AM
Bob Ward from PSS has a wonderful blog article that explains the details about the re-release of SQL Server 2005 SP2 and fixes posted later. This is a must read for anyone deploying SQL Server 2005 SP2 to understand the various hotfixes, GDRs and procedures. Please visit his link for more details. SQL Server 2005 SP2 Re-release and post fixes -- Umachandar ...
by SQL Server Engine Team via SQL Server Engine Tips on 3/30/2007 9:53:12 PM
Check out the new Books Online search functionality online. The link below provides a scoped search of Books Online that returns a more precise and targeted result set. You can use it to search Books Online content quickly. http://search.live.com/macros/sql_server_user_education/booksonline Please direct your feedback to SQLServerUE@hotmail.com. -- Umachandar ...
by SQL Server Engine Team via SQL Server Engine Tips on 3/29/2007 10:22:43 PM
The SQL Server 2005 Performance Dashboard Reports are Reporting Services report files designed to be used with the Custom Reports feature introduced in the SQL Server 2005 SP2 release of SQL Server Management Studio. The reports allow a database administrator to quickly identify whether there is a current bottleneck on their system, and if a bottleneck is present, capture additional diagnostic data that may be necessary to resolve the problem. For example, if the system is experiencing waits fo ...
by SQL Server Engine Team via SQL Server Engine Tips on 3/24/2007 2:24:46 AM
SQL Server 2005 SP2 has an important enhancement to OBJECT_NAME metadata function and a new OBJECT_SCHEMA_NAME metadata function. I will first describe the old functionality to give some context and demonstrate how the new features help a lot. Please note that the examples uses DMVs that looks at metadata in each database or plan cache so performance of the queries depends on your environment, number of objects in the database, auto open/auto close setting of database, size of buffer pool o ...
by SQL Server Engine Team via SQL Server Engine Tips on 2/28/2007 3:16:15 AM
I would like to announce the blog from my team - SQL Server Performance Engineering. Feel free to visit our blog at http://blogs.msdn.com/sqlperf for your performance related questions and needs. Use the email link in the home page to share your feedback on performance and topics of interest. -- Umachandar Jayachandran ...
by SQL Server Engine Team via SQL Server Engine Tips on 2/4/2007 10:16:00 PM
My team (Data & SQL Storage Performance Team) is conducting a survey on http://connect.microsoft.com/sqlserver to better understand SQL Server workloads. The connect link below will take you directly to the survey: https://connect.microsoft.com/SQLServer/Survey/Survey.aspx?SurveyID=2226 Please consider providing your workload characteristics and hardware configuration to help us better understand the workloads that run on SQL Server. This is a detailed survey so we are hoping t ...
by SQL Server Engine Team via SQL Server Engine Tips on 9/21/2006 2:35:00 AM
Hello Everyone, We are currently looking at top performance issues for various workloads and how we can improve those in next version of SQL Server. We are collecting feedback from various customer sources. I would like to extend an invitation to readers here for feedback on top 5 relational data warehouse performance improvements you would like to see in SQL Server. Please bear the following in mind: 1. Briefly describe the relational data warehouse workload or scenario or applic ...
by SQL Server Engine Team via SQL Server Engine Tips on 9/6/2006 9:31:00 PM
Did you know that the catalog views in SQL Server 2005 exposes metadata for various objects in a database and at the server-level? This is the preferred method of accessing metadata. It is a much richer mechanism that doesn't require access to system tables or undocumented columns or status bits. If you want standard and portable access to metadata then you can still use the INFORMATION_SCHEMA views but it is limited to standard specific features, data types and views. I have posted ...
by SQL Server Engine Team via SQL Server Engine Tips on 7/15/2006 2:25:00 AM
DATALENGTH function in TSQL can be used to find the actual length in bytes of the data in a specific value. The value can be any of the data types. It is often used to determine length of LOB data type columns (text, ntext, image, varchar(max), nvarchar(max) and varbinary(max)) in a table. One of the question that comes up regarding use of DATALENGTH on LOB columns is whether it requires reading the entire value. For example, if the text or varchar(max) value is 16 MB in size does SQL Server nee ...
by SQL Server Engine Team via SQL Server Engine Tips on 5/16/2006 1:03:00 AM
I saw an interesting question today in the MSDN Transact-SQL forum about implementing PERCENTILE_CONT analytic function that is available in Oracle in SQL Server. The function description as noted in the Oracle docs is below: The PERCENTILE_CONT function is an inverse distribution function that assumes a continuous distribution model. It takes a percentile value and a sort specification, and returns an interpolated value that would fall into that percentile value with respect to the sort ...
The content of the postings is owned by the respective author. SQL Feeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on SQL Feeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.