回複:回複:Thanks. But in VB6...

來源: dbdb 2004-01-13 08:45:00 [] [舊帖] [給我悄悄話] 本文已被閱讀: 次 (1157 bytes)
本文內容已被 [ dbdb ] 在 2004-02-06 15:24:48 編輯過。如有問題,請報告版主或論壇管理刪除.
回答: 回複:如果要求第8行的結果dbdb2004-01-12 12:41:00
1
The line of {IDENTITY(int, 1,1) AS row_Num} is called
pseudo-column, it means that column does not existing in schema but needed to support application function.
2
When you use SQL Server's IDENTITY() function, it requests to supply those 3 paramenters, please see SQL server Book-online for details.
3-1
In the real cases when use it, I would write a store procedure with such script, then use pass-through query to call the procedure. This way has very good performance, especially on a larger table, even you can add index on it if you need to do so.
3-2
If you want to use it in VB, I suggest use a sead number
for example 1, then write it in a loop (1++) to gain similar integer array. Under this situation, you should be able to control your random specified row number(s).
But this way runs slower.
3-3
Write a SQL function with to generate a sequential number when you query a table.
3-4
I do not have time to provide another sample code for your because I am on project rollout time. Also, I do not have your problem in my data warehouse system, I solve such potential problem when data modeling.





--文學城www.wenxuecity.com--
請您先登陸,再發跟帖!

發現Adblock插件

如要繼續瀏覽
請支持本站 請務必在本站關閉/移除任何Adblock

關閉Adblock後 請點擊

請參考如何關閉Adblock/Adblock plus

安裝Adblock plus用戶請點擊瀏覽器圖標
選擇“Disable on www.wenxuecity.com”

安裝Adblock用戶請點擊圖標
選擇“don't run on pages on this domain”