在使用 SQL Server 的過程中,使用者遇到最多的問題莫過於串連失敗了。一般而言,有兩種串連SQL Server 的方式,一是利用 SQL Server 內建的用戶端工具,如企業管理器、查詢分析器、事務探查器等;二是利用使用者自己開發的用戶端程式,如ASP 指令碼、VB程式等,用戶端程式中又是利用 ODBC 或者OLE DB等串連 SQL Server。下面,我們將就這兩種串連方式,具體談談如何來解決串連失敗的問題。 一、"SQL Server 不存在或訪問被拒絕"(圖1)"SQL
關鍵字: spring串連ms sql server中出現的錯誤 org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket. Caused by:
由於需要給同事培訓資料庫的索引知識,就收集整理了這個系列的部落格。發表在這裡,也是對索引知識的一個總結回顧吧。通過總結,我發現自己以前很多很模糊的概念都清晰了很多。不論是緩衝的資料資訊,還是物理儲存的資訊,他們的基本單位都是資料頁。所以理解資料頁是最最基礎的知識點,本篇部落格就介紹跟索引有關的資料頁的一些基礎知識。資料頁的基礎知識SQL Server 中資料存放區的基本單位是頁(Page)。資料庫中的資料檔案(.mdf 或 .ndf)分配的磁碟空間可以從邏輯上劃分成頁(從 0 到 n 連續編號)
1.對查詢進行最佳化,應盡量避免全表掃描,首先應考慮在 where 及 order by 涉及的列上建立索引。 2.應盡量避免使用 left join 和 null 值判斷。left join 比 inner join 消耗更多的資源,因為它們包含與 null (不存在)資料匹配的資料,所以如果可以重新編寫查詢以使得該查詢不使用任何 inner join ,則會得到相應的回報。 例如有兩表: product(product_id int not null,product_type_id int
11 SQL Server 2000資料庫管理資料庫作為資料庫物件的儲存容器,對資料庫的管理就成了資料庫物件管理的基礎。下面我們來介紹如何建立、修改和刪除資料庫。1.1.1 建立資料庫建立資料庫的方法主要有下面3種。(1) 使用嚮導建立資料庫選擇“開始”|“程式”| Microsoft SQL Server |“企業管理器”命令,啟動SQL Server企業管理器。首先,展開伺服器組,選擇並啟動要建立資料庫的伺服器。然後開啟“工具”下拉式功能表,選擇“嚮導”命令,則會出現“選擇嚮導”對話方塊,
---------數學函數 1.絕對值 S:select abs(-1) value O:select abs(-1) value from dual 2.取整(大) S:select ceiling(-1.001) value O:select ceil(-1.001) value from dual 3.取整(小) S:select floor(-1.001) value O:select floor(-1.001) value from dual 4.取整(
第四章,Transact-SQLP80cast和convert直接在查詢分析器裡輸入select cast(12345 as char),convert(int,3.14),convert(bit,12.33)select cast(100+88 as char),convert(varchar(10),getdate())select getdate(),convert(char(12),getdate(),1), --幾種時間格式convert(char(24),getdate(),100
1取得異常訊息select description from master..sysmessages where error = @@error 2根據主鍵查詢表的列名select name from syscolumns where id=object_id('表名') and colid in( select colid from sysindexkeys where object_id('表名')=id and indid in( select indid from