Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 29th, 2003, 06:15 AM
Authorized User
 
Join Date: Jun 2003
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default Return Data Structure in SQL Server 2000

Any one know if it possible to create SQL Server script to return information on any field in the Table; ie Field Name, var type for example int, nvarchar, etc. Also the variable size.
- for example Table1 has Field A is nvarchar and size 50 chars, should returns
Field Name = 'Field A'
Var type - nvarchar
and size - 50

If you can help, I would be greatful... thanks in advance

Regards
Kasie. :)
 
Old June 29th, 2003, 06:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

Look in BOL at the INFORMATION_SCHEMA.COLUMNS view.

You can also get what you are looking for from the 'sp_columns' system stored procedure, although the view is a bit more flexible since you can SELECT only the information you need from it.

Either of these methods is preferable to querying the 'syscolumns' system table directly (which of course also works), IMO.

Jeff Mason
Custom Apps, Inc.
www.custom-apps.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to shrink data files in SQL Server 2000 chintan SQL Server 2000 6 October 15th, 2008 01:58 PM
SQL Server 2000 data fetching overrideme VB Databases Basics 0 April 21st, 2008 09:05 AM
Import Data In MS SQL SERVER 2000 The Beginner Classic ASP Basics 1 August 14th, 2006 04:59 PM
How to export SQL Server 2000 data in kwilliams XML 13 November 30th, 2005 10:20 AM
Data Shaping In SQL Server 2000 nidgep SQL Server ASP 5 August 29th, 2003 03:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.