---
title: "查询数据库中的表和表中的字段"
author: "devilhand"
date: "2010-11-05T09:25:21Z"
tags: []
categories: ["数据库"]
slug: "untitled"
draft: false
lastmod: "2010-11-05T09:34:59Z"
id: 803425
url: "https://devilhand.iteye.com/blog/803425"
---

```
--查询数据库中的全部表
select * from sysobjects where xtype='U' order by name

--查询表中的全部字段
Select name FROM SysColumns Where id=Object_Id('buy') order by colid
```