sql server單一某列實現排序

2021-06-21 13:27:22 字數 4123 閱讀 7312

use [yj]

go/****** object: table [dbo].[t_oa_wdstore] script date: 04/16/2014 00:23:38 ******/

set ansi_nulls on

goset quoted_identifier on

goset ansi_padding on

gocreate table [dbo].[t_oa_wdstore](

[wdbh] [nvarchar](50) not null,

[wdmc] [nvarchar](500) not null,

[wdlx] [nvarchar](50) null,

[wdsx] [nvarchar](50) null,

[wddx] [nvarchar](50) null,

[wdyyr] [nvarchar](50) null,

[wdzt] [int] null,

[wdms] [nvarchar](500) null,

[wdzz] [nvarchar](50) null,

[wdlj] [nvarchar](500) null,

[systemid] [nvarchar](50) null,

[wdbt] [nvarchar](200) null,

[dqbb] [decimal](9, 0) null,

[wdhz] [nvarchar](50) null,

[cjsj] [datetime] null,

[cjr] [nvarchar](50) null,

[xgsj] [datetime] null,

[xgr] [nvarchar](50) null,

[orgid] [nvarchar](20) null,

[sfzsgw] [char](1) null,

[minorsid] [varchar](50) null,

constraint [pk_t_oa_wdstore] primary key clustered

( [wdbh] asc

)with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary]

) on [primary]

goset ansi_padding off

goexec sys.sp_addextendedproperty @name=n'ms_description', @value=n'文件編號' , @level0type=n'schema',@level0name=n'dbo', @level1type=n'table',@level1name=n't_oa_wdstore', @level2type=n'column',@level2name=n'wdbh'

gogo

exec sys.sp_addextendedproperty @name=n'ms_description', @value=n'文件名稱' , @level0type=n'schema',@level0name=n'dbo', @level1type=n'table',@level1name=n't_oa_wdstore', @level2type=n'column',@level2name=n'wdmc'

goexec sys.sp_addextendedproperty @name=n'ms_description', @value=n'文件型別' , @level0type=n'schema',@level0name=n'dbo', @level1type=n'table',@level1name=n't_oa_wdstore', @level2type=n'column',@level2name=n'wdlx'

goexec sys.sp_addextendedproperty @name=n'ms_description', @value=n'文件屬性' , @level0type=n'schema',@level0name=n'dbo', @level1type=n'table',@level1name=n't_oa_wdstore', @level2type=n'column',@level2name=n'wdsx'

goexec sys.sp_addextendedproperty @name=n'ms_description', @value=n'文件大小' , @level0type=n'schema',@level0name=n'dbo', @level1type=n'table',@level1name=n't_oa_wdstore', @level2type=n'column',@level2name=n'wddx'

goexec sys.sp_addextendedproperty @name=n'ms_description', @value=n'文件擁有人' , @level0type=n'schema',@level0name=n'dbo', @level1type=n'table',@level1name=n't_oa_wdstore', @level2type=n'column',@level2name=n'wdyyr'

goexec sys.sp_addextendedproperty @name=n'ms_description', @value=n'文件狀態' , @level0type=n'schema',@level0name=n'dbo', @level1type=n'table',@level1name=n't_oa_wdstore', @level2type=n'column',@level2name=n'wdzt'

goexec sys.sp_addextendedproperty @name=n'ms_description', @value=n'文件描述' , @level0type=n'schema',@level0name=n'dbo', @level1type=n'table',@level1name=n't_oa_wdstore', @level2type=n'column',@level2name=n'wdms'

goexec sys.sp_addextendedproperty @name=n'ms_description', @value=n'文件作者' , @level0type=n'schema',@level0name=n'dbo', @level1type=n'table',@level1name=n't_oa_wdstore', @level2type=n'column',@level2name=n'wdzz'

goexec sys.sp_addextendedproperty @name=n'ms_description', @value=n'文件路徑' , @level0type=n'schema',@level0name=n'dbo', @level1type=n'table',@level1name=n't_oa_wdstore', @level2type=n'column',@level2name=n'wdlj'

goexec sys.sp_addextendedproperty @name=n'ms_description', @value=n'文件標題' , @level0type=n'schema',@level0name=n'dbo', @level1type=n'table',@level1name=n't_oa_wdstore', @level2type=n'column',@level2name=n'wdbt'

goexec sys.sp_addextendedproperty @name=n'ms_description', @value=n'文件版本號' , @level0type=n'schema',@level0name=n'dbo', @level1type=n'table',@level1name=n't_oa_wdstore', @level2type=n'column',@level2name=n'dqbb'

goexec sys.sp_addextendedproperty @name=n'ms_description', @value=n'文件字尾' , @level0type=n'schema',@level0name=n'dbo', @level1type=n'table',@level1name=n't_oa_wdstore', @level2type=n'column',@level2name=n'wdhz'

go

SQL Server 如何設定某列自增

對於已經建好的資料庫表,可以採用兩種方法來修改 若還有疑問可以看看最後的備註 1 通過sql server management studio修改 我使用的是2012版的 選擇資料庫表右鍵 設計表 點一下你要修改的列 在下方看到列屬性 將標識規範點開 在 是標識 那選擇是就改好了 完成以後如下所示 ...

Sql Server中如何判斷表中某列是否存在

比如說要判斷表a中的字段c是否存在兩個方法 一,if exists select 1 from sysobjects t1 inner join syscolumns t2 on t1.id t2.id where t1.name a and t2.name c print 存在 else prin...

實現單一程序

有時候,乙個模組x會被其他模組函式呼叫,模組x會產生很多的實現程序,具有不同的pid號。也許模組x在系統執行時只需要乙個實現程序就可以實現它對系統的服務功能,而執行多個實現程序則會造成對系統資源的浪費,而且在某些情況下,如果模組x是對某個硬體的控制,同時執行多個程序則會導致對硬體資源的搶奪,對硬體的...