Tuesday, August 25, 2009

Partitioning utility - EASEUS Partition Master Home Edition (FREE)


"EASEUS Partition Master Home Edition is a FREE disk partitioning utility for extending system partition, better disk space management, settling low disk space problem under Windows 2000/XP/Vista"
http://www.partition-tool.com/personal.htm

Overview:

* Extend system partition to maximize computer performance.
* Main features for better managing hard disk and maximizing computer performance.
* Copy wizard to backup all data or copy entire hard disk to another without Windows reinstallation.
* Usability features allow you to operate directly on the disk map with the drag-and-drop and preview the changes.


Main Features:

* Resize/Move partitions without data loss
* Extend system partition easily and safely
* Create, Delete and Format partitions with simple steps
* Support up to 2TB partition or hard drive
* Disk Copy, Partition Copy, Dynamic Disk Copy to protect or transfer da
Share/Bookmark

Monday, August 17, 2009

SQL - How to rename a DATABASE physically in MS SQL Server 2008

As you know sp_renamedb stored procedure does not rename the database data files. I prefer to have the database data files contain a matching database name. If I have a database named [myDataBase], then the data files would typically be myDataBase.mdf and myDataBase_Log.ldf, simple and neat. In this way, just with take a look at the files, I can remember which SQL database they are talking about. Otherwise it's confusing.

SQL 2008 allows us to rename a database using T-SQL and the sp_renamedb stored procedure has been deprecated. ALTER DATABASE can do the job for us.

You can code as following to do the job:

1- Change your database name:
ALTER DATABASE oldDataBase
MODIFY NAME = newDataBase
GO

2- Rename master data file (.mdf):
ALTER DATABASE AutoMac
MODIFY FILE(NAME = 'oldDataBase', NEWNAME = 'newDataBase' )
GO

3- Rename log file:
ALTER DATABASE AutoMac
MODIFY FILE(NAME = 'oldDataBase_Log', NEWNAME = 'newDataBase_Log' )
GO

4- Assign new full path file name to renamed master data file:
ALTER DATABASE AutoMac
MODIFY FILE (NAME='newDataBase', FILENAME='C:\mySQLfiles\newDataBase.mdf')
GO

5- Assign new full path file name to renamed log file:
ALTER DATABASE AutoMac
MODIFY FILE (NAME='newDataBase_Log', FILENAME='C:\mySQLfiles\newDataBase_Log.ldf')
GO

6- Now you need to take the database offline (Tasks->Take Offline) and bring it back online (Tasks->Bring Online), then you don't need to detach and attach your database again.
Share/Bookmark

Saturday, August 15, 2009

SQL Server 2008 - Warning: Saving Changes Not Permitted

If [Prevent saving changes that require table re-creation] option in [Table Options] of [Designers] in SSMS [SQL Server Management Studio] is ON, when you want to save a table that requires the table be dropped and recreated behind the scenes, you will see the following warning. It can happen if you want to modify a column data type, data type size, or to add a new column in a specific location, or ...



Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created.

The solution is turn off the option in Tools -> Options then go to [Designers] page and uncheck [Prevent saving changes that require table re-creation] option.




Share/Bookmark

Friday, August 14, 2009

SQL - How to rename a DATABASE in MS SQL Server 2005/2008

You could change the DATABASE name by calling sp_renameDB system stored procedure but it will be deprecated in future versions.
EXEC sp_renameDB 'myOldDB','myNewDB'


sp_renamedb (Transact-SQL)
http://msdn.microsoft.com/en-us/library/ms186217.aspx

According to MSDN document in above URL you better Use ALTER DATABASE MODIFY NAME Instead of sp_renameDB to rename.
"This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use ALTER DATABASE MODIFY NAME instead. For more information, see ALTER DATABASE (Transact-SQL)."

ALTER DATABASE (Transact-SQL)
http://msdn.microsoft.com/en-us/library/ms174269.aspx

/* Rename the Database myOldDB to myNewDB */
ALTER DATABASE myOldDB MODIFY NAME = myNewDB
GO


But none of above mentioned commands change Physical Name of database files, how can we change Physical file names of MS SQL Database files (DB and Log files) ? it comes in next blog entry, cheers.
Share/Bookmark

Sunday, August 9, 2009

XSD - XML Schema constraints and value checks


Share/Bookmark

Friday, August 7, 2009

Valid XHTML document


An XHTML document is technically an XML document. XML documents can include an XML declaration as the first line in the document, something like this:
<?xml version="1.0" encoding="UTF-8"?>

There are only a few major rules to consider, but you have to follow them if you want to create a valid XHTML document. Here they are in brief:

* In an XHTML document every tag must be closed.
* Empty elements without content, must be correctly closed with a closing slash.
For example, a break tag is formatted <br />.
* Tags must be nested correctly,
it works like a LIFO queue, the last tag you open must be closed first.
* All XHTML tags should be in lowercase.
* All attribute values are enclosed in quotation marks.
* A valid XHTML document needs a valid XHTML DOCTYPE declaration.

The DOCTYPE declaration works for several purposes:
* DOCTYPE helps your page to be validated as XHTML.
* DOCTYPE allows the browser knows the version of your page markup language.
* DOCTYPE references the specific DTD for your page markup language.
* DOCTYPE enables your page to be displayed properly in standard web browsers
(IE, Netscape Navigator, Mozilla, Firefox, Opera, Chrome, and ...).

For an XHTML 1.0 document, you can choose one of three different DOCTYPES:
- strict
- transitional
- frames

- strict DOCTYPE declaration:
If for presenting and styling your document you are using CSS.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

- transitional DOCTYPE declaration:
If your document includes any presentational or styling markup code.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

- frames DOCTYPE declaration:
If your document is in frames.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

The easiest to use is the transitional DOCTYPE declaration, but using CSS to present document sometimes is the best way.

After XHTML DOCTYPE declaration, it must have an additional line of markup:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

In XHTML, the above line works instead of the opening <html> in HTML document. It adds information about the XHTML namespace. (A namespace is basically a vocabulary of elements and attributes)
Share/Bookmark

Monday, August 3, 2009

.NET - Can I remove .NET Framework 1.0 or 1.1 now that I have 2.0 or later on my machine?


Yes, you can! cheeers, it's because of side by side execution manner in earlier versions (1.0, 1.1, 2.0). I keep it, cuz it doesn't occupy too much space.

- But there are some breaking changes in .NET Framework 2.0 if you have an application which wants to run on version 1.0 or 1.1 if you remove those versions.

Breaking Changes in .NET Framework 2.0
http://msdn.microsoft.com/en-us/netframework/aa570326.aspx

- Look at the .NET Framework 3.5 Architecture,:
http://msdn.microsoft.com/en-us/library/bb822049.aspx

"The relationship of the .NET Framework versions 2.0, 3.0, and 3.5 differs from the relationship of versions 1.0, 1.1, and 2.0. The .NET Framework versions 1.0, 1.1, and 2.0 are completely separate from each other, and one version can be present on a computer regardless of whether the other versions are present. When versions 1.0, 1.1, and 2.0 are on the same computer, each version has its own common language runtime, class libraries, compiler, and so forth. Application developers can choose which version to target."

- The .NET Framework 2.0 was a generational release over the .NET Framework 1.0 but .NET Framework 3.0 (and later) adds new technologies (additive release).

How .NET Framework 3.0 Relates to .NET Framework 2.0 and Earlier
http://msdn.microsoft.com/en-us/library/aa480198.aspx#netfx30_topic3

"The .NET Framework 3.0 adds new technologies to the .NET Framework 2.0, which makes the .NET Framework 3.0 a superset of the .NET Framework 2.0. You can think of .NET Framework 3.0 as an "additive" release to the .NET Framework 2.0, as contrasted with a generational release where software is revised across the board. (For example, the .NET Framework 2.0 was a generational release over the .NET Framework 1.0.)

Because .NET Framework 3.0 is an additive release and uses the core run-time components from .NET Framework 2.0, it is completely backward compatible with the earlier version. Your existing .NET Framework 2.0 based-applications will continue to run without any modifications and you can safely continue your investments using the technologies that shipped with .NET Framework 2.0."

The same question in social.msdn: Which version of Framework .net?
http://social.msdn.microsoft.com/Forums/en-US/netfxsetup/thread/0387a1d6-404b-48d4-9d8c-53aefcb75d7b

.NET Framework article in WiKiPedia is also interesting:
http://en.wikipedia.org/wiki/.NET_framework

Share/Bookmark

Sunday, August 2, 2009

One year Blog anniversary


It's a happy day, one year ago when I started this blog, I wanted to share something with others as others shared something with us. I'm happy to be part of this unfinished sharing story, then let's share more.
Share/Bookmark