sqlones
1. 調試sql查詢語句mysql_fetch_row時,瀏覽器總是顯示worning:。。。。請大師看下哪裡錯了
寫錯了 $sql="SELECT * FROM 'onetb'";
這個 換成
$sql="SELECT * FROM `onetb`";
或者
$sql="SELECT * FROM onetb";
這里 數據表名字 兩邊用的不是單引號( ' ) 是 ( ` ) 符號 也可以省略
2. [SQL Server]從字元串轉換為 datetime 時發生語法錯誤
sql="select
count(id)
as
ones
from
[data]
where
emdate>'2009-01-01'
backtime
is
not
null
and
DATEADD(day,1,backtime))<=arrivetime
如果varchar中存儲的字串與日期格式相符,進行datetime運算時可以顯示轉換
3. 請問怎麼用sql篩選互斥事務
select * from sheet4 AS A
where not exists (select * from sheet4 where 對應的事務代碼<A.對應的事務代碼 and 對應的事務代碼=A.互斥的事務代碼 and 互斥的事務代碼=A.對應的事務代碼)
4. sql2005的資料庫還原到sql2000
一老外文章,按步驟做就可以了
As you may all know, SQL Server 2005 request a minimum of 8GB RAM to work… let』s say satisfactorily. I first didn』t know that and after a while from the upgrade I did from SQL Server 2000 to 2005 my SQL Services were starting to crash three or four times per DAY!!!
At first I thought I was being attacked, but soon I realized it was nothing like that. I then decided to downgrade to a SQL Server 2000 edition. Though I looked around the internet to find some information on how to do that, I got very disappointed when I realized that no actual documentation of any kind could be found for that. So I am posting this thread to inform you on the proceres I had to follow for this action.
Before beginning I must assume, firstly that the user, who will attempt such thing, has a basic knowledge of SQL Environment, secondly that he has the two versions already installed (both 2000 and 2005), that a basic backup of the databases has been created and finally that all the 2005 SQL Server Users have been created at the SQL Server 2000 environment as well.
Step 1: Generating Scripts for the Database Elements and Structures
1. Right-click over the desired Database at 2005, Choose Tasks and the Generate Scripts (Option).
2. At the pop-up Dialog Box click at the Script All Objects in the selected Databases check box, to activate it and then Click the Next Button.
3. Set the following Elements to the following Values
1. Script Collation , set to TRUE
2. Script Database Create, set to TRUE
3. Script of SQL Version, set to SQL SERVER 2000
4. Script foreign keys, set to FALSE
5. Script Triggers, set to FALSE Then Hit the Next button
4. Select the way the generated scripts should be saved (There are different selections. The most common one is Clipboard). Finally click the Next button till you reach the end.
5. Click Finish
After completing this procere, we have to move to the SQL SERVER 2000 environment. Here, by using the Query Analyzer, we will have to run the scripts that were generated using the master database. Copy and Paste the script at the Query Analyzer and run it. After that the Structure of the Database will be created.
Be careful, the SQL Server 2005 Edition inserts the Views in a random place through the script. Therefore, all the scripts that are referred to the Views MUST be moved to the end of the script. If the Query Analyzer shows some errors do not be bothered. Delete all the elements created from the script and after you fix the code run it again.
Step 2: Moving the data from 2005 to 2000
1. After completing the previous step successfully, moving the data follows. Right-click at the 2005 database you used to run the previous step and select Tasks and then choose the Export Data (option).
2. From the pop-up Dialog Box, select the Source Db and Click at the Next Button.
3. At the next step you will have to choose the destination server and the destination Database for the Data to be exported. Then Click Next.
4. A List of all the Source Database’s Elements will appear in the screen. Select one by one all the Elements you wish to move and for each one click at the button Edit Mappings (Located at the bottom right corner of the Dialog Box just under the Elements list). A new Dialog box will pop-up. Select the Delete rows in Destination Tables option and activate the Enable Identity Insert Option. (Remember to repeat this action for each of the selected Element from the list that will be moved.
CAUTION!!! A malfunction of the SQL Server 2005 has been found. Not sure why, after multiple tries I have observed that when I tried to move more than twelve Elements at once, the Export Data Wizard of SQL Server 2005 seemed to disable the Enable Identity Insert Option that was activated over the Edit Mappings Dialog Box. But if the number of the selected Elements is smaller than 12 no problem seemed to appear.
Step 3: Generating Scripts for the Database Foreign Keys and Triggers
Finally, to successfully finish the downgrade of the Database, the Triggers and the Foreign Keys of the DB must be proced. The procere that should be followed is the one stated next:
1. Right-Click at the SQL 2005 Database and Select from Tasks Menu the Generate Scripts Option.
2. Using the pop-up Dialog Box make sure that the check box Script All Objects in the selected Databases is not enabled and hit the Next Button.
3. Set all the Elements on the List to a False Value except the ones that follow:
1. Include IF NOT EXISTS , set to TRUE
2. Script Owner, set to TRUE
3. Script of SQL Version, set to SQL SERVER 2000
4. Script foreign keys, set to TRUE
5. Script Triggers, set to TRUE
6. Then Hit the Next button
4. After finishing reading the Elements of the Database, a new list will appear at the Dialog Box. Make sure that you select ONLY THE TABLES of the Database and hit the Next Button.
5. At the screen that follows hit the Select All button and the Next.
6. Select the way the generated scripts should be saved (There are different selections. The most common one is Clipboard). Finally click the Next button till you reach the end.
7. Click Finish Button.
After completing this procere, we have to move to the SQL SERVER 2000 environment. Here, by using the Query Analyzer, we will have to run the scripts that were generated using the master database. Copy and Paste the script at the Query Analyzer and run it. After that the Foreign Keys and the Triggers of the Database will be created.
After these steps the database should be fully functional under the SQL Server 2000 edition.
5. .net關於資料庫連接字元串|DataDirectory|是什麼意思
|DataDirectory| 是指 App_Data目錄
這個目錄是專門用來放資料庫的,更安全,建議你放在這個目錄,
放在其它目錄,如果別人知道你的資料庫具體路徑,可以直接下載,而放在|DataDirectory| 就算別人知道具體路徑也是無法下載的
如果你想放在其它路徑!可以直接填完整地址
比如 Data Source=C:\data\Data.accdb;
6. sql函數調用返回值為空
CREATE FUNCTION GetPayedMoneyByCard(@paysequence varchar(10))
RETURNS numeric
AS
BEGIN
DECLARE @TempMoney numeric
select @TempMoney = sum(isnull(payedmoney,0)) from tbpayaddones where paysequence=@paysequence
return @TempMoney
END
7. 電腦維護軟體(工具)
你得有一套系統盤。
桌面極的,winxp、win7、win8。win2000、win vista;
伺服器極的,win nt、win 2000、win 2003、win 2008;
有可能還要知道:linux、unix、mac等系統。
資料庫:sql server、mysql、oracle;
殺毒:瑞星、卡巴斯基、金山、kv、360等。我說的都是網路版本不是單版本。
辦公軟體:wps、office 2003、2007、2012;
輸入法:QQ五筆、搜狗輸入法。
驅動:驅動精靈
winpe光碟版本,U盤版本。
系統備份軟體:ghost
硬體:防火牆、路由器、二層交換機、三層交換機、無線路由器、UTM。
線路上要了解:雙絞線、光纖、無線。
不間斷供電:UPS。
對伺服器要了解:塔式伺服器,機架式伺服器,刀片式伺服器,小型機。
有些公司還要求:電話交換機、監控器、門禁、考勤。
還有一些系統:如OA、郵件、財務、人力資源、固定資產。公司網站等。
終端電腦及周邊設備:台式機、筆記本、掃描儀、列印機、復印機、傳真機。
還有些公司會有會議系統:比如投影、音響、mic、錄音、錄像。
8. 如何把my sql中資料庫還原到sql server 2000中
一老外文章,按步驟做就可以了
As you may all know, SQL Server 2005 request a minimum of 8GB RAM to work… let』s say satisfactorily. I first didn』t know that and after a while from the upgrade I did from SQL Server 2000 to 2005 my SQL Services were starting to crash three or four times per DAY!!!
At first I thought I was being attacked, but soon I realized it was nothing like that. I then decided to downgrade to a SQL Server 2000 edition. Though I looked around the internet to find some information on how to do that, I got very disappointed when I realized that no actual documentation of any kind could be found for that. So I am posting this thread to inform you on the proceres I had to follow for this action.
Before beginning I must assume, firstly that the user, who will attempt such thing, has a basic knowledge of SQL Environment, secondly that he has the two versions already installed (both 2000 and 2005), that a basic backup of the databases has been created and finally that all the 2005 SQL Server Users have been created at the SQL Server 2000 environment as well.
Step 1: Generating Scripts for the Database Elements and Structures
1. Right-click over the desired Database at 2005, Choose Tasks and the Generate Scripts (Option).
2. At the pop-up Dialog Box click at the Script All Objects in the selected Databases check box, to activate it and then Click the Next Button.
3. Set the following Elements to the following Values
1. Script Collation , set to TRUE
2. Script Database Create, set to TRUE
3. Script of SQL Version, set to SQL SERVER 2000
4. Script foreign keys, set to FALSE
5. Script Triggers, set to FALSE Then Hit the Next button
4. Select the way the generated scripts should be saved (There are different selections. The most common one is Clipboard). Finally click the Next button till you reach the end.
5. Click Finish
After completing this procere, we have to move to the SQL SERVER 2000 environment. Here, by using the Query Analyzer, we will have to run the scripts that were generated using the master database. Copy and Paste the script at the Query Analyzer and run it. After that the Structure of the Database will be created.
Be careful, the SQL Server 2005 Edition inserts the Views in a random place through the script. Therefore, all the scripts that are referred to the Views MUST be moved to the end of the script. If the Query Analyzer shows some errors do not be bothered. Delete all the elements created from the script and after you fix the code run it again.
Step 2: Moving the data from 2005 to 2000
1. After completing the previous step successfully, moving the data follows. Right-click at the 2005 database you used to run the previous step and select Tasks and then choose the Export Data (option).
2. From the pop-up Dialog Box, select the Source Db and Click at the Next Button.
3. At the next step you will have to choose the destination server and the destination Database for the Data to be exported. Then Click Next.
4. A List of all the Source Database’s Elements will appear in the screen. Select one by one all the Elements you wish to move and for each one click at the button Edit Mappings (Located at the bottom right corner of the Dialog Box just under the Elements list). A new Dialog box will pop-up. Select the Delete rows in Destination Tables option and activate the Enable Identity Insert Option. (Remember to repeat this action for each of the selected Element from the list that will be moved.
CAUTION!!! A malfunction of the SQL Server 2005 has been found. Not sure why, after multiple tries I have observed that when I tried to move more than twelve Elements at once, the Export Data Wizard of SQL Server 2005 seemed to disable the Enable Identity Insert Option that was activated over the Edit Mappings Dialog Box. But if the number of the selected Elements is smaller than 12 no problem seemed to appear.
Step 3: Generating Scripts for the Database Foreign Keys and Triggers
Finally, to successfully finish the downgrade of the Database, the Triggers and the Foreign Keys of the DB must be proced. The procere that should be followed is the one stated next:
1. Right-Click at the SQL 2005 Database and Select from Tasks Menu the Generate Scripts Option.
2. Using the pop-up Dialog Box make sure that the check box Script All Objects in the selected Databases is not enabled and hit the Next Button.
3. Set all the Elements on the List to a False Value except the ones that follow:
1. Include IF NOT EXISTS , set to TRUE
2. Script Owner, set to TRUE
3. Script of SQL Version, set to SQL SERVER 2000
4. Script foreign keys, set to TRUE
5. Script Triggers, set to TRUE
6. Then Hit the Next button
4. After finishing reading the Elements of the Database, a new list will appear at the Dialog Box. Make sure that you select ONLY THE TABLES of the Database and hit the Next Button.
5. At the screen that follows hit the Select All button and the Next.
6. Select the way the generated scripts should be saved (There are different selections. The most common one is Clipboard). Finally click the Next button till you reach the end.
7. Click Finish Button.
After completing this procere, we have to move to the SQL SERVER 2000 environment. Here, by using the Query Analyzer, we will have to run the scripts that were generated using the master database. Copy and Paste the script at the Query Analyzer and run it. After that the Foreign Keys and the Triggers of the Database will be created.
After these steps the database should be fully functional under the SQL Server 2000 edition.
9. @讀音是什麼
「@」讀音是ài tè。在我國,@的讀音也出現了多個讀法,比較流行的有兩種:一是「圈a」,二是「花a」。實際上,在電子郵箱的表示形式中,@有著at的含義,即「某用戶」在「某伺服器」。在電子郵箱的表示形式中,應該根據此處@的具體含義,將其讀作at的讀音——「艾特」。
「@」是一個符號,電郵應用中意義為「at」,即「某用戶」在「某伺服器」。它在社交應用如微博中也有廣泛應用。在英文狀態下輸入鍵是上檔鍵(shift)+2,或者使用 Alt+64(按住Alt並在小鍵盤上輸入64,然後松開Alt)。
(9)sqlones擴展閱讀
來歷:
就職於美國國防部發展軍用網路阿帕網BBN電腦公司的電腦工程師雷·湯姆林森帶來了這場劃時代的變革。1971年,湯姆林森奉命尋找一種電子郵箱地址的表現格式。他編寫了一個小程序:
可以把程序的文件轉移協議與另外一個程序的發信和收信能力結合起來,使一封信能夠從一台主機發送達到另外一台。於是,第一封電子郵件就誕生了。湯姆林森把程序最後搞定時,給工作人員發了一封郵件,告訴他們可以給其它電腦發信了。湯姆林森說:「所以,電子郵件是自己宣布問世。」
10. SQL查詢重復以及刪除重復的命令
您好,刪除2條完全一樣的數據
http://hi..com/wangqing999/blog/item/e90c4012ae8b5d0c962b4357.html
至於 刪除包含中文數據, 條件就是 LEN( 欄位1 ) <> DATALENGTH (欄位1)
參考下面這樣的 SQL 語句:
SELECT
LEN('中文') AS [字元的長度],
DATALENGTH('中文') AS [字元所佔位元組數];
字元的長度 字元所佔位元組數
----------- -----------
2 4
(1 行受影響)
SELECT
LEN('English') AS [字元的長度],
DATALENGTH('English') AS [字元所佔位元組數]
字元的長度 字元所佔位元組數
----------- -----------
7 7
(1 行受影響)