January 2005 - Posts - Jon Galloway

January 2005 - Posts

Unofficial Firefox 1.1 changelog

Unofficial Firefox 1.1 changelog 
Full Firefox 1.1 release plan on the Firefox Wiki


Firefox 1.1 (Preview Release) scheduled for April 2005
Firefox 1.1 Release scheduled for June 2005

Firefox Roadmap / Schedule [here]

[via anne van kesteren]

Posted by Jon Galloway | with no comments

[wish] "CREATE TABLE ... LIKE" in SQL Server 2005

My friend Dave recently told me about the "CREATE TABLE ... LIKE " SQL statement. MySql and DB2 both support it, and it's apparently part of the SQL99 spec. It's not supported by T-SQL (SQL Server).

CREATE TABLE LIKE is quick way of cloning the structure of an existing table, including any indexes (but not foreign keys). This can be particularly useful in creating new tables to be added to an existing MERGE table.

mysql> CREATE TABLE log_20041124 LIKE log_20041123;

As far as I know, this will not be supported by T-SQL, despite all the other SQL enhancements in Yukon. You can copy everything except the keys / indexes with "SELECT INTO":
 
select * into CustomersCopy from Customers where 1 = 0
 
That copies the structure, but doesn't copy the indexes.

One other trick I learned a bit ago: you can select a table in Enterprise Manager and hit control - c. Then go to notepad / query analyzer / etc. and paste to get the create table statement (with all the indexes and stuff). You can also right click a table in Query Analyzer and select "Script Object To New Window As..." to get a Create statement. Still, none of these offers quite what the CREATE TABLE ... LIKE statement does - script level copy of table scructure and indexes.

Posted by Jon Galloway | 1 comment(s)
Filed under:

Tracing Enhancement in ASP.NET 2.0 - MostRecent

Back in June 2003 I posted a wish for wrapping in ASP.NET the Trace stack:

The NT Event Log "Wrapping" feature is really handy - it would be great if the Trace log had that. Right now, it fills up with 10 entries and just stops. Yeah, you can change the number of entries, but it would be cool if you could tell it to just keep the last 10 entries.

It looks like my wish has been granted with the  MostRecent attribute for tracing in ASP.NET 2.0:

In ASP.NET 1.x, if the requestLimit exceeds, it will stop collecting trace messages in trace store unless until you clear trace store or restart that application appdomain. Now the Trace settings in config file will looks like, 

           <trace
                  enabled="false"
                  localOnly="true"
                  
mostRecent=”true”
                  pageOutput="false"
                  requestLimit="10"
                  traceMode="SortByTime"
            />

When you set this attribute value to true and if the requestLimit values exceeds, Trace store will keep the most recent trace messages in the store and old message are discarded. If you set this attribute value to false, trace store will stop collecting trace message once its requestLimit value exceeds.

[viaTracing Enhancements in ASP.NET 2.0  - Saravana's Blog]

Posted by Jon Galloway | with no comments
Filed under:

LogParser and WMI: separated at birth?

LogParser: a cool tool that supports SQL-like queries against "text-based data such as log files, XML files and CSV files, as well as key data sources on the Windows® operating system such as the Event Log, the Registry, the file system, and Active Directory®." [via MSDN]

"Windows Management Instrumentation (WMI) provides access to information about objects in a managed environment. Through WMI and the WMI application programming interface (API), applications can query for and make changes to static information in the Common Information Model (CIM) repository and dynamic information maintained by the various types of providers." [via MSDN]

Have these two met? They have a lot in common, and should maybe join forces.

I mean, both use a SQL-Like query language to retrieve system information. WMI uses WQL, and LogParser uses... well, there doesn't seem to be a name for it, but it's a "SQL-Like language". There's even some overlap - for instance, both can query the Event Log.

And while I'm at it, doesn't Clark Kent look a bit like Superman?

powered by IMHO 1.2

Posted by Jon Galloway | with no comments
Filed under:

[tip] Use WinMerge for compare / merge in StarTeam

We use StarTeam for source control at my work. I'm not a huge StarTeam fan, and I think the compare / merge portion is pretty much unusable. Fortunately, you can pick your own alternative merge and compare utilities. I like WinMerge . Here's how to set it up:

1. Tools / Options / File tab.
2. Check "Merge utility" and "Comparison utility" checkboxes.
3. Browse to WinMergeU.exe
4. Enter the following for merge utility options: /dl "StarTeam Version" /dr "Your Changes" $branchtip $usertip $resultfile
5. Enter the following for comparison utility options: /dl "StarTeam or Older Version" /dr "Your Changes or Newer Version" $file1 $file2

References:
WinMerge command line info: http://winmerge.sourceforge.net/2.2/manual/commandline.html
Araxis Merge integration info for various source control systems: http://www.araxis.com/merge/scm_integration.html

powered by IMHO 1.2

Posted by Jon Galloway | 1 comment(s)
Filed under:

[tools] Log Parser 2.2 is out

Log Parser 2.2 is out (via Bernard at Server: Microsoft-IIS/6.0\r\n). Download it [here]. If you aren't familiar with Log Parser, check out www.logparser.com.

From the docs, here's what's new in Log Parser 2.2:

New Input and Output Formats:

XML Input Format
Reads XML files (requires the Microsoft® XML Parser (MSXML))
TSV Input Format
Reads tab- and space- separated values text files
ADS Input Format
Reads information from Active Directory objects
COM Input Format
Makes it possible to plugin user-implemented custom Input Formats
REG Input Format
Reads information from the Windows Registry
NETMON Input Format
Makes it possible to parse NetMon .cap capture files
ETW Input Format
Reads Event Tracing for Windows log files and live sessions
CHART Output Format
Creates chart image files (requires Microsoft Office 2000 or later)
TSV Output Format
Writes tab- and space- separated values text files
SYSLOG Output Format
Sends information to a SYSLOG server or to a SYSLOG-formatted text file

Improvements to the SQL Engine:

Exponential performance improvement in SELECT DISTINCT and GROUP BY queries
"WITH ROLLUP" functionality in the GROUP BY clause
"DISTINCT" in aggregate functions
(when no GROUP BY clause is specified)
"PROPSUM(...) [ ON <fields> ]" and "PROPCOUNT(...) [ ON <fields> ]" aggregate functions
(these functions calculate the ratio between the SUM or COUNT functions on a field and the SUM or COUNT functions on the same field in a hierarchically higher group)
New functions:
  • MOD
  • BIT_AND, BIT_OR, BIT_NOT, BIT_XOR, BIT_SHL, BIT_SHR
  • EXP10, LOG10
  • ROUND, FLOOR
  • QNTROUND_TO_DIGIT, QNTFLOOR_TO_DIGIT
  • STRREPEAT
  • IN_ROW_NUMBER, OUT_ROW_NUMBER
  • ROT13
  • EXTRACT_FILENAME, EXTRACT_EXTENSION, EXTRACT_PATH
  • HEX_TO_ASC, HEX_TO_PRINT, HEX_TO_INT
  • HEX_TO_HEX8, HEX_TO_HEX16, HEX_TO_HEX32
  • IPV4_TO_INT, INT_TO_IPV4
  • HASHSEQ, HASHMD5_FILE
  • EXTRACT_PREFIX, EXTRACT_SUFFIX
  • STRCNT
Introduced a "USING" clause for declaring temporary field-expressions
"BETWEEN" operator in the WHERE and HAVING clauses
"CASE" (simple-form) statement in the SELECT clause
("SELECT CASE myField WHEN 'value1' THEN '0' WHEN 'value2' THEN '1' ELSE '-1' END")
New date and time formats:
  • l (milliseconds - lower case 'L')
  • n (nanoseconds)
  • tt (AM/PM)
  • ? (any character)
Fields and Aliases are now case-insensitive

Improvements to existing Input and Output Formats:

Added many new parameters to most of the Input and Output Formats
The NCSA input format now parses also combined and extended NCSA log files
Added "EventCategoryName" and "Data" fields to the EVT input format
The "-recurse" options of most input formats now specify a maximum subdirectory recursion level
The CSV Input and Output Formats now support CSV files with double-quoted strings
Added "FileVersion", "ProductVersion", "CompanyName", etc. fields to the FS input format
Allowed '*' and '?' wildcards in the site name specifications for all the IIS input formats
("SELECT * FROM <mysite*.com>")
Allowed URL's as the input path of all text-based input formats
("SELECT * FROM http://www.adatum.com/table.csv")
Allowed use of environment variable names in the TPL output format sections, and added a SYSTEM_TIMESTAMP variable
Performance improvement in the EVT input format when reading from local and remote event logs
All the property names of the input and output format COM objects now match the command-line names

General improvements:

Added the possibility to specify parameters in .sql files
( "logparser-file:myquery.sql?param1=value1+param2=value2")
Input I/O performance improvement for text files
Added the possibility to permanently override the default values of global options, input format options, and output format options
("logparser -e:10 -o:NAT -rtp:-1 -savedefaults")

 

powered by IMHO

Posted by Jon Galloway | with no comments
Filed under:

[sql] T-SQL Quiz

Question:

A user executes the following two queries in SQL Server Query Analyzer. Query 1 returns no rows; Query 2 returns one row. Why?

--QUERY 1
SELECT * FROM INFORMATION_SCHEMA.COLUMNS 
WHERE TABLE_NAME = 
'ExampleTable' 
AND COLUMN_NAME = 'Description'

--QUERY 2
SELECT * FROM sysobjects, syscolumns 
WHERE sysobjects.id = syscolumns.id
AND sysobjects.name = 
'ExampleTable' 
AND syscolumns.name = 'Description'

Note: This is of importance if you are using the clause in an insert script:

IF NOT EXISTS (SELECT * FROM sysobjects, syscolumns WHERE sysobjects.id = syscolumns.id
 AND sysobjects.name = 
'ExampleTable' 
 
AND syscolumns.name = 'Description')
  alter table dbo.ExampleTable 
add Description varchar(50)
GO

My Answer:

The INFORMATION_SCHEMA.COLUMNS view checks permissions and only shows columns accessable to the current user. INFORMATION_SCHEMA lives in the master database, so the user's rights may be much more restricted on this view. sysobjects and syscolumns live in the current database.

Bottom line: Users may have broader rights under the systables than the INFORMATION_SCHEMA views.

powered by IMHO

Posted by Jon Galloway | with no comments
Filed under:

New Google tag... rel="nofollow"?

Scoble mentioned this morning that Google would be announcing a new tag today, so I've been keeping my eyes peeled. Anne van Kesteren just blogged about it - it looks like it's rel="nofollow".

Simon Willison seems to spell it out the best:

Reading between the lines (which in this case isn't particularly hard), this and this (don't forget to view source) suggest that Google are soon to announce that they won't be calculating PageRank for links with a rel="nofollow" attribute. Finally, an official way of fighting the economics of comment spam by denying PageRank on user-submitted link content. Sam Ruby points to Mark Pilgrim's prediction that spammers won't care - they'll spam anyway, on the offchance that they hit somewhere undefended. I'm optimistic - if the major weblog (and wiki) vendors get behind this one it could help stem the tide.

This is cool - it lets content link sources control the page rank boost they give to the link target - perfect for comment spam, forum spam, etc. Let's hope that Mark Pilgrim is wrong - if this really does make comment spam ineffective, maybe it will at least slow down a bit.

powered by IMHO

[fyi] Known bug in RSSBandit 1.3 Alpha - OPML Import

Managing a big feed list is a pain in the neck. The weblogs.asp.net group feed continues to add new posters (good), but the only mechanism I've found to add them in RSSBandit (or any of the other aggregators I've used) is to

  1. Get completely caught up[1]
  2. Delete the entire weblogs.asp.net folder
  3. Import the weblogs.asp.net OPML

Steps 1 and 2 complete, but the RSSBandit 1.3 Alpha has a known problem with OPML import (namely, it doesn't work) that will hopefully be fixed in the Beta release.

I agree with Michael Earls - I'm getting really sick of depending on these poorly re-implemented technologies. OPML should be able to support heirarchies and allow external links, so one node of my OPML would just point to the weblogs.asp.net OPML.[2]

Why does it seem like this RSS stuff is being driven by a bunch of php script kiddies? We're on the edge of quantum computers and robots vacuum our rooms - can't we do better than this for content syndication?


[1] A major achievement - due to a very aggressive project schedule 4th Quarter 04, I got way behind and had over 5500 unread posts two weeks ago. I'm all caught up now.

[2] Plan B would seem to be to just subscribe to the weblogs.asp.net recent posts feed . Unfortunately, this prevents me from even hibernating my machine, or I miss posts.

powered by IMHO

Posted by Jon Galloway | with no comments

[link] How to Script SQL Server User and Role Object Permissions

I needed to copy user permissions between two SQL Server environments; this script did the trick: http://www.sql-server-performance.com/bm_object_permission_scripts.asp

powered by IMHO

Posted by Jon Galloway | with no comments
Filed under:
More Posts Next page »