I'm CaLendarW Blog

error handling

Error 29506 when installing SQL Server 2005 Management Studio Express on Windows 7

by calendarw on Aug.25, 2009, under error handling

部 x60 今日好似傻傻地, 所以係部 tx2 度預備返個 development environment, 而用開 xp 既我, 換左 win7 之後連入野都好似有 d 問題……
好在係網上搵到以下呢個 procedure:
  1. Click “All Programs”, select “Accessories”, right click the Command Prompt shortcut and select “Run as Administrator”.
  2. Click “Yes” to accept the warning
  3. Use command “cd” to navigate to the installation directory.
  4. Type the installation file to execute file. (e.g. SQLServer2005_SSMSEE_x64.msi) and complete the installation.
Leave a Comment :, , , more...

MsSQL – Identity Generator

by calendarw on Jul.07, 2009, under database, error handling

MsSQL 內既 Identity Generator, 雖然被發現當 Table 儲存超過一百萬行時, 由 SELECT @@Identity 或者 SELECT SCOPE_IDENTITY() 會存在 Return 值錯誤既問題, 但經過呢個幾月既開發都未出現問題.

係 MsSQL 入面, 新增 Record 時主要提取 Primary Key 既方法主要有 @@IDENTITY, SCOPE_IDENTY() 同 IDENT_CURRENT(‘table_name’) 三種:

@@IDENTITY
使用 @@IDENTITY 會 Return 當前 Session 任何 Table 最後生產的 Primary Key, 如果 Insert statement 運行後如果有任何 Trigger 中會 Insert 在其他 Table 的話, @@IDENTITY 就會變得不準確.

SCOPE_IDENTY()
使用 SCOPE_IDENTY() 會 Return 當前 Scope 內確實 Insert 左既 Primary Key, 就算有任何 Trigger 在背後運行都不會有任何影響, 係一個最好既選擇. 不過經由 MS Connect 入面既 Feedback 顯示, Table 被新增至一百萬行後, Return Value 有可以會籨 1 開始數起, 這問題由 MS 回應既答案中回答到已增加到它們的 Bug tracking database 中.

IDENT_CURRENT(‘table_name’)
而 IDENT_CURRENT(‘table_name’) 會 Return 指定 Table 最後生產出來的 Identity, 由於它不會理會任何 Scope 或者 Session, 當有多於一個 Scope 或者 Session 運行時便有機會出現不準確既問題.

因此, 在以上三個尋找 IDENTITY 既方法中, 並沒有一個能在任何環境下百分百準確既方法, 所以在 MsSQL 使用 Identity Generator 便會有潛在問題既可能性, 因此在 deploy 前應該對 Database 作詳細測試, 已確定當前既環境設定正確.

再者, Identity Generator 亦開始慢慢地被其他類型既方案取代, 例如 GUID, Hi/Lo or UUID 等等.

正如之前 CS != SE 文章內所講, Technology 其實永遠唔會有錯, 錯就只會錯在未能正確使用它們既人, 而軟件其中一個用途就係用來避免人們使用犯錯, 所以在程式篇寫時應該以不同既設定技巧及文檔來避免人們使用錯誤, 那軟件才容易正確地被使用!!

Leave a Comment : more...

Avoid identity generator when possible

by calendarw on Apr.15, 2009, under diary, error handling

係 Ayende 個 Blog 度見到呢個 post, 入面講述應該避免使用 identity.
(continue reading…)

Leave a Comment : more...

PROPFIND of ‘/svn’: 301 Moved Permanently

by calendarw on Nov.19, 2008, under error handling, setup

前排裝左個 subversion, 係 web 睇係無問題, 所以預備好之前都無乜理佢. 尋日想用果時, 用 TortoiseSVN checkout 就發現出左以下問題

PROPFIND of ‘/svn’: 301 Moved Permanently

結果發現, comment 左 DocumentRoot 之後就無問題啦~~

Leave a Comment : more...

Adding ListItems don’t work with CheckboxList,RadiobuttonList etc.

by calendarw on Oct.09, 2007, under error handling

This is a bug of asp.net in 1.0 and 1.1, you may need to use HtmlInputRadioButton instead of RadioButtonList or HtmlSelect instead of DropDownList

Microsoft Article: 309338

Leave a Comment : more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!