My name is Edward Tanguay. I am a web developer in Berlin, Germany. I learn everything I can and record it on this site. Other things you might be looking for: My Ubuntu Tutorial My Datapod Project My Blog Feed:  |  - Code Examples
|
SQL SERVER CODE EXAMPLE - added on January 28, 2003
How to create a simple clustered index
This is simple code you can type into your SQL Query Analyzer to see how a clustered index works.
prabhu: After creating index, what is procedure to see the speed and efficiency of the indexes replyreply post comment or questionpost comment or question |
|
|
Similar Code Examples:
|
This code shows you how to get the meta information about your database, nice for making interfaces which can edit any database, etc.
post comment or questionpost comment or question |
|
|
In Northwind, create a table called "Members" with the fields FirstName and LastName. The execute this statement and you will see how only the first and last name from Employees are put into the table Members.
post comment or questionpost comment or question |
|
|
To format dates in and SQL command, use the funcation CONVERT function, see the documentation for other formats.
post comment or questionpost comment or question |
|
|
When updating a database you have to be careful that you don't forget a WHERE clause and change everything. Therefore in SQL Query Analyzer it is good to work in the following manner: (1) do your select statement so you can SEE which records will be affected, (2) then add your update statement and COMMENT OUT the select statement (important), (3) then comment out the UPDATE and WHERE statements so that you see all of your records.
post comment or questionpost comment or question |
|
|
If you need to have the results from SELECT statement to be in random order, use the NEWID() function.
| post comment or questionpost comment or question |
|
|
|
The SQL CASE command can save you lots of SELECT backbending, here is an example. This works in SQL Server but should work in other databases, too, try it out.
post comment or questionpost comment or question |
|
|
If you have an website with an SQL Server at an ISP, then you need to be able to copy database tables back and forth from your development computer to your ISP. I went though a number of constellations of settings before I found a sure-fire way to do it with the DTS wizard, here is I do it, you may need to tweek it a bit if, for instance, you need to also copy triggers, etc.
post comment or questionpost comment or question |
|
|
I was looking around for ways of finding out how big tables and databases are in SQL Server. Here are some code snippets which do the job.
post comment or questionpost comment or question |
|
|
SQL SERVER CODE EXAMPLE
- added on January 28, 2003
This code shows you how to get a standard date regardless of the localization of the server?
post comment or questionpost comment or question |
|
|
SQL SERVER CODE EXAMPLE
- added on January 28, 2003
One of the problems when adding a parent and child record is that you need the ID number of the parent to create the child. This code shows you how to do it with the @@IDENTITY.
| post comment or questionpost comment or question |
|
|
| My Free Tutorials: How to Install the Android SDK on Windows XP and Create an Application that Runs in the Cell Phone Emulator How to Create a Website with Datapod Install Fedora 6 in VMWare on Windows XP and connect it to your network Install Perl 5 on Windows XP and Get a Perl Hello World Running Install OpenSuse 10.2 in VMWare on Windows XP and connect it to your network Install Ubuntu 7.04 in VMWare on Windows XP and connect it to your network Install Java on Windows XP and Learn the Basics of Java 6 using the NetBeans IDE Setup a PHP Development Environment on Windows XP With Apache, PHP 5, MySQL 5, SQLite, Eclipse, Subversion, PHPMyAdmin, and Datapod Install a PHP Development Environment with Eclipse PDT, Apache 2.2, PHP 5, MySQL 5, and phpMyAdmin Using XAMPP Lite How to Install Ruby on Rails with Instant Rails and Create a Website Using JEdit and the Ruby Plugin  |