Thursday, June 18, 2009

How do I create a simple table in a database on SQL Server 2008 and populate it?

Let us say you want to create a table such as the one shown in this example (PrincetonTemp2) and populate it with some values. There is more than one way to create a table in SQL Server 2008.This one uses Create Table query to create a table. You then edit the table to insert the values. Values can also be inserted using code. In here, the query creates the table and you then manually insert the data.

Step 1: Create table using the query
In SQL Server 2008 right click the database in which you want to create a table and choose New Query






Type in the Query window as shown in the next figure. Check the syntax of the query by clicking the icon at the far right of the figure. Execute the query by clicking the (!)Execute.








You will have created a table called PrincetonTemp2. You can see it in the Tables node after you refresh the database by right clicking the database node and choosing Refresh from the list.

Step 2: Populate the table by editing the table :
Right click the table in the Management Studio after expanding the database node.










From the drop-down click on Edit Top 200 Rows.
In the table that shows up fill in the data you want to insert. The data has to match the query you used to create the table. One line inserted is shown in the next figure.


Friday, May 15, 2009

What is Caret Browsing?

It is the new accessibility feature in IE 8.0. You can use less of the mouse and more of the keyboard to select portions of content in IE 8.0.

It is not turned on by default, but you may turn it on by pressing the key F7 when your cursor is placed on a web page opened in IE 8.0.

The first time you click F7 while you are on web page you will see the following message.


You can read more about it by clicking on the hyperlink in the message.









Here is a demo.

Caret Browsing turned off (default)
Click any where on a web page opened in IE8.0 and then try to use your Shift and the navigation keys (right,left, top, down) to highlight content. You will not be able to select text.

Caret Browsing turned  on
Click anywhere on the web page. Hit F7. Enable the Caret browsing.  Now with the Shift and navigation keys (right,left, top, down) you can select content just like you were able to do with your mouse.

The only problem is IE 8.0 is very slow!!

Wednesday, April 29, 2009

Can you chain remote desktop connections?

Yes you can.



You can link up multiple machines. Of course you will be using only one computer.

I have computer XPHTEK which I can access from my computer Hodentek.

I have a Laptop with WIFI wireless connected to the above two computers. I can access Hodentek as a remote connection from my laptop HODENTEK2 and from within the remote connection I can remote access XPHTEK. I have some word processing in a language other than English in each of these computers but I can work on them in my laptop and print it out to a shared printer on HODENTEK.

Wednesday, April 15, 2009

I installed MySQL, how do I know what version I have and how to start and stop it?

If you installed MySQL it is probably in the directory where it is installed. For example, I recently installed XMAPP which brings in a bundle of stuff like Apache, MySQL, PHP etc. In this case, it was installed in the Xampp directory in the C drive.

You have to see if you have an executable program called mysql.exe among many other executbles and confi files.

If you have mysql.exe you should try to connect to it as in the following
snippet:

C:\xampp\mysql\bin>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 36
Server version: 5.1.30-community MySQL Community Server (GPL)


Type 'help;' or '\h' for help. Type '\c' to clear the buffer.


Try the help and get everything you need

The control should now go over from C:\ to mysql>

The first thing to do is to verify the version you have on your computer.

For this, do this, do not forget the semi-colon:

mysql> Select version(),Current_Date;
+------------------+--------------+
| version()        | Current_Date |
+------------------+--------------+
| 5.1.30-community | 2009-04-13   |
+------------------+--------------+
1 row in set (0.05 sec)

I assume you have no start and stop shortcuts for the server. If you do have you can start and stop from the shortcuts or when you have a window with start and stop buttons for the server.

Thursday, April 9, 2009

What are 'breadcrumb' links?

This is a navigational aid in web pages. In Figure 1, I have gotten to the last page on a shopping site and the highlighted region is where you find the 'breadcrumbs'. One step back (which you can reach by clicking on that particular crumb[Brand:Acer Comuter]) will bring you back to the page pointing to that crumb, Figure 2.

Figure 1






Figure 2








Tuesday, March 24, 2009

How can I change the color of the DOS screen?

I am bored of the black color, how can I change it?

It's rather easy. You can configure the DOS window and change some of the things around. Color for one is easy to change.

Open a DOS Window from Start | Run

Right click the top of  DOS window inside the title bar. From the drop-down click on Defaults. This opens the following window.





















Now click on the Colors tab in the above window. I have changed both the Screen Background as well as the Screen Text. You can immediately see the changes you are making.


















The next time you open the DOS window you will see the changes provided you clicked OK to the above screen after the changes.

Sunday, March 1, 2009

What is Upsert?

Upsert provides the following SQL functionality:

If something does not exist in a table then insert it. If it exists then update it.

This is something like what happens when you move a file to a folder, if the file exists it will ask you whether you want to replace it with a new version or not. If the file does not exist it is inserted, no questions asked.

This is implemented by MERGE in SQL Server 2008