Geeks With Blogs
Eron Wright - All Killer No Filler blog September 2004 Entries
Working with Query Analyzer and FOR XML

If you work with SQL Server 2000 and FOR XML functionality, you curse Query Analyzer probably as often as I do.  Here are some tips for improving the output:

  1. In QA, set “Maximum Characters per Column” setting to 2033
  2. Execute DBCC TRACEON(257) to pretty-print the XML output

Posted On Wednesday, September 15, 2004 2:40 PM

UTC datetime values in SQL Server 2000
You can convert local datetime values to UTC datetime values, and vice-versa, using the built-in GETUTCDATE() function: DECLARE @LocalDate DATETIMESET @LocalDate = GETDATE() -- convert local date to utc dateDECLARE @UTCDate DATETIMESET @UTCDate = DATEADD(Hour, DATEDIFF(Hour, GETUTCDATE(), GETDATE()), @LocalDate) -- convert utc date to local dateDECLARE @LocalDate2 DATETIMESET @LocalDate2 = DATEADD(Hour, DATEDIFF(Hour, GETDATE(), GETUTCDATE()), @UTCDate) SELECT @LocalDate, @UTCDate, @LocalDate2 Note ......

Posted On Tuesday, September 14, 2004 11:35 PM

Copyright © Eron Wright | Powered by: