Wednesday, November 26, 2008

Default Value

Add default value in table schema

alter table [table_name]
add CONSTRAINT [DF_tableName_columnname] DEFAULT (0) for columnname

Thursday, November 20, 2008

Vulnerabilities in GDI+ Could Allow Remote Code Execution (954593)

SQL 2005 Service Pack

MS08-052 - Vulnerabilities in GDI+ Could Allow Remote Code Execution (954593)
download from here

If your system already upgrade to
"Vulnerabilities in Microsoft SQL Server Could Allow Elevation of Privilege (941203) MS08-040"
You need to apply MS08-052
refer to Microsoft Website
"The update for the selected product has been replaced by the update in the following bulletin(s): MS08-052". Selected Product refer to "MS08-040"

Tuesday, November 18, 2008

Change SQL 2000 port from 1433 to Dynamic Port

Yesterday, I install SQL 20005 as second instance on top of SQL 2000 in my server and testing. After testing successful, I shutdown SQL 2000 and change SQL 2005 port from dynamic to 1433.

Today, I need check job task in SQL 2000 and try to start the SQLServer and it fail. Both SQL server using same port 1433 and only one SQLServer can start.

How to start SQL 2000 without shutdown SQL 20005 now?
First thing in my mind is change port of SQL 2000 to dynamic port but I can't find how to change to dynamic port.

Google and Microsoft article :
To configure your instance of SQL Server to use a dynamic port, follow these steps:
1. Start the Server Network Utility. To do this, do either one of the following:
• Click Start, point to Programs, point to Microsoft SQL Server, and then click Server Network Utility.
• Click Start, and then click Run. In the Open box, type svrnetcn.exe, and then click OK.
The SQL Server Network Utility dialog box appears.
2. In the SQL Server Network Utility dialog box, click the General tab.
3. In the Instance(s) on this server list, select your instance of SQL Server.

Note If TCP/IP protocol is disabled, enable it now. To do this, click TCP/IP in the Disabled Protocols list box, and then click Enable.
4. In the Enabled Protocols list box, click TCP/IP, and then click Properties.
5. In the Default port box, type 0, and then click OK.
6. Click OK, and then click OK again.
7. Restart the instance of SQL Server.
8. View the SQL Server error logs to verify whether the instance of SQL Server is currently using the dynamic port.

How to configure an instance of SQL Server to listen on a specific TCP port or a dynamic port

Monday, November 17, 2008

SQL 20005 Second Instance

We have install SQL 2005 with second instance on top on SQL 2000 Server. When we try connecting to SQL 2005 server through our pc, we can't. I check the SQL login and try connecting from SQL Server itself, connection successful. I shut down SQL 2000 and try telnet new instance from my pc, “telnet servername 1433” fail.

Check and found, If we install second instance of SQL Server, the listen port of SQL server will be dynamic.

We can check from:
1. Protocol for SQL 2005
- From Start->All Programs->Microsoft SQL 2005 Server ->Configuration Tools-> SQL - Server Configuration Manager -> SQL Server 2005 Network Configuration -> TCP/IP
- Double click on TCP/IP, check on IP Address TAB, TCP Port. If TCP port is empty, then SQL will listen on dynamic IP.
- Check on IPAll, TCP Dynamic Ports or TCP port.

2. Check from SQL Server Log
- From Start->All Programs->Microsoft SQL 2005 Server ->SQL Management Studio
- > SQLServerName -> Management -> SQL Server Log
Right Click on SQL Server Logs -> Select on View
- >Look for Source = Server, Message = Server is listening on [ 'any' 1433]
- 1433 is the port SQL Server listens on

Saturday, November 08, 2008

SQL 2005 Services Pack 3 coming soon?

SQL 2005 Services Pack 3 coming soon? SQL Server 2005 Service Pack 3 - CTP already release for testing at 27/10/2008.

"The release have been made available for general testing purposes only. Do not deploy the CTP software in production."

Click here for more information