SELECT表名 = Case When A.colorder=1 Then D.name Else ‘‘ End,表说明 = Case When A.colorder=1 Then isnull(F.value,‘‘) Else ‘‘ End,字段序号 = A.colorder,字段名 = A.name,字段说明 = isnull(G.[value],‘‘),标识 = Case When ColUMNPROPERTY( A.ID,A.name,‘IsIDentity‘)=1 Then ‘√‘Else ‘‘ End,主键 = Case When exists(SELECT 1 FROM sysobjects Where xtype=‘PK‘ and parent_obj=A.ID and name in (SELECT name FROM sysindexes WHERE indID in( SELECT indID FROM sysindexkeys WHERE ID = A.ID AND colID=A.colID))) then ‘√‘ else ‘‘ end,类型 = B.name,占用字节数 = A.Length,长度 = ColUMNPROPERTY(A.ID,‘PRECISION‘),小数位数 = isnull(ColUMNPROPERTY(A.ID,‘Scale‘),0),允许空 = Case When A.isnullable=1 Then ‘√‘Else ‘‘ End,默认值 = isnull(E.Text,‘‘)FROMsyscolumns Aleft Joinsystypes BOnA.xusertype=B.xusertypeInner Joinsysobjects DOnA.ID=D.ID and D.xtype=‘U‘ and D.name<>‘dtpropertIEs‘left Joinsyscomments EonA.cdefault=E.IDleft Joinsys.extended_propertIEs GonA.ID=G.major_ID and A.colID=G.minor_IDleft Joinsys.extended_propertIEs FOnD.ID=F.major_ID and F.minor_ID=0--where d.name=‘OrderInfo‘ --如果只查询指定表,加上此条件Order ByA.ID,A.colorder总结
以上是内存溢出为你收集整理的导出sqlserver数据库设计语句全部内容,希望文章能够帮你解决导出sqlserver数据库设计语句所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)