View & Edit Table Definition

This post briefly explains the different views available for Managing a Table’s definition using Data Utensil.

This is where you can view the columns, indexes and foreign keys of a Table.

Table definition is comprised of several views:-

Structure

Table Structure

This view shows the columns of a table and their properties such as:-

  • Data Type – The datatype of the column.
  • Size – The size of the column (if applicable)
  • Precision – The precision of the column (if applicable)
  • Scale – The scale of the column (if applicable)
  • Primary Key – Whether or not the column is part of the Primary Key
  • Nullable – Whether or not the column can store NULL values
  • Unique – Whether the values of the column must be unique
  • Identity – Whether it is an Identity column of SQL Server whose values are automatically generated by the database on insertion
  • Collation – The collation of the column

Indexes

Indexes

Indexes for this table along with their properties are listed here.

  • Type – The type of the Index – Clustered, Non Clustered, etc
  • Name – The name of the Index
  • Columns – The columns on which the Index applies
  • Unique – Whether it is a Unique Index
  • Primary Key – Whether it is a Primary Key Index

Foreign Keys

Foreign Keys

Foreign keys of the table and their properties are found here.

  • Constraint Name – The name of the foreign key constraint
  • Referenced Table – The referenced (Master) table of the foreign key
  • Referencing Table – The referencing (Child) table of the foreign key
  • Referenced Columns – The columns in the master table which are part of the foreign key
  • Referencing Columns – The columns in the child table which are part of the foreign key
  • On Update – The ON UPDATE rule for the foreign key
  • On Delete – THe ON DELETE rule for the foreign key

SQL Definition

Table Definition

This view shows the SQL query that can be used to create the Table.

Sql Preview

SQL Preview

As you make changes to an existing table or add columns, indexes and foreign keys to a new table, the SQL that will be fired to make the changes are shown in this view.

Table Properties

This view shows the basic properties for the table such as its’ Name, Schema, etc.

How to create your own Web Scraper

There are two different steps involved in Web Scraping:-

1. Crawling web pages
2. Extracting data from these web pages

Typically, there is a starting URL from where other links are discovered. You can filter these links to restrict the pages that are crawled. XPath is a wise choice for this filtering.

Once you have the HTML content of a page, you can extract any piece of information from it. Once again, XPath comes to the rescue for extracting the data.

Pay attention to the terms of use of the website you are trying to crawl. Don’t extract data from websites that forbid it.

On a side note, you can test out our Web Scraper to see how it is done.

Storing GUID/UUID in a Firebird database

Use the CHAR data type with a size of 16 and the OCTETS character set. This saves the value in binary, thus saving a few bytes.

Use the following if you are trying to insert values to a GUID column using ADO .NET:-

((FbParameter)parameter).FbDbType = FbDbType.Guid;

Convert the Guid value to a string representation using the following code:-

((Guid)value).ToString("D")

Search & Remove Duplicate Files

Unsurrogater is a product of ours that lets you search for duplicate files in Hard Disk Drives, CD/DVD Roms, USB Flash Drives, FTP Servers, Sharepoint Servers & Compressed Files.

Armed with a plethora of features, Unsurrogater sports a clean user interface that builds on a Job Category based navigation. The duplicate search process itself is very intuitive to start as the wizards guide you to setting up the job.

Search Result

Results are viewed hierarchically in a Tree Table display.

Auto Marking

Files can be marked manually or using the Auto Mark feature that takes hints from the user & automatically selects files across the entire result.

Actions

After marking the files, users can choose to perform operations such as copy, move, delete, archive, replace by hard links, etc.

Reports

Results can be stored historically for viewing later or exported as an HTML/XML Report.

Result Combination

A key feature of Unsurrogater is the ability to combine the search results of multiple jobs & discover new duplicates. This saves a lot of time as you don’t have to run the job again for the files already scanned.

Reflector to the Rescue

I was trying to get a list of all un-versioned C# code files in my working copy. Some examples on the internet pointed to Windows Power Shell which is able to pipe the output of one command to another (kind of what we have in linux).

The command was:-

(svn stat) -match '^\?.*\.cs$'

The following command gave a much cleaner output (just the full path of the files)

(svn stat "--no-ignore") -match '^\?.*\.cs$' -replace '^.\s+',''

The next command deleted those files from the PC.

(svn stat "--no-ignore") -match '^\?.*\.cs$' -replace '^.\s+','' | rm

I did not pay attention to what the command does and executed it. Net result was that my precious source codes were gone. I looked for the files in the recycle bin. But, being a command line program, it does not seem to use the recycle bin. Then I tried NTFS undelete which is able to restore files that were deleted ‘permanently’ too. What happens is that when you delete a file (SHIFT + DELETE, skipping the recycle bin), windows merely marks the space the file occupied in the disk as free. This is done for performance reasons (a delete operation would take time that is comparable to writing to a file, otherwise).

However, to my dismay, NTFS undelete was unable to find the file. Perhaps it was because of Windows 7 and it’s ways of handling different versions of a file.

It seemed like I would have to re-create the files again. But, then it occurred to me that reflector could come in handy. I had compiled the project previously. So, the debug directory had the compiled assemblies. I used reflector to get the source files back. Although not the exact as the original, the decompiled code was good enough for me to re-create the custom user-control.

Subversion Bug – Case Insensitive Username

I spent a complete day trying to find the cause for an access denied error while committing changes to the Maxotek Repository. At first it seemed like a program was using one of the files. However, even restarting the system had no effect. Then, I tried to leave out the culprit file from the commit and wasa greeted by the “Access Denied” message again, only this time without a mention of any file as the cause.

I tried deleting the cached passwords from %AppData%\Subversion\Auth\svn.simple. The next time I got the dialog asking for the account information. I typed the username & password in but still got the error.

While at work, I tried doing the commit and it worked. So, it seemed like an IP address ban. But, then again I don’t have a static IP address. Also, the Update, Revert, Check Out commands worked without a hitch.

Then it occurred that it could be a ban by domain name. I use No-IP to map my dynamic IP address to a domain. So, I changed the domain but the results were the same.

I finally tracked it down to being a case-sensitivity issue in the username. A Check Out, Revert, Update was being allowed from a username User but Commit was not. The actual username being user.

What’s up with Maxotek?

Some of you may know that Maxotek is a one man company. It was always my dream to setup a software company and distribute softwares. During the last few years, I have reached closer to the dream, with Maxotek making a bit of name. Creating intuitive softwares for every day users, has been the main goal.

It has been difficult to do all this, while still pursuing my degrees. Support from the users has been a great encouragement. Last month (25th of May, to be precise), I started working at Global IDs as a Trainee Software Developer using Java technologies. Global IDs specializes in Data Integration on a large scale. Maxotek takes a step back in terms of my priority.

Chances of new softwares being released is very little. But, we will continue to provide technical support to our valued customers. One day, Maxotek will be back as my main goal. But, until then, there is a lot I must learn, especially the software process models and the business aspects of running a company.