Technical Article

How to get ColumnNames, datatypes and length

This is a followup to the script submitted by srallapalli. One can return a record set of all tables in a database using the following:USE MyDatabaseSELECT so.name AS TableName, sc.name AS ColumnName,  st.name AS ColumnDatatype,  convert(int, sc.length) AS ColumnLength FROM syscolumns sc, sysobjects so , systypes st WHERE so.type='U' AND OBJECTPROPERTY(so.id,'ismsshipped') = 0 AND sc.id=so.id […]

You rated this post out of 5. Change rating

2003-05-10

151 reads

Blogs

Resetting on the AI hype train

By

There's a great article from MIT Technology Review about resetting on the hype of...

A New Word: Etherness

By

etherness – n. the wistful feeling of looking around a gathering of loved ones,...

Vibe Coding a Login Tracking System

By

A customer was asking about tracking logins and logouts in Redgate Monitor. We don’t...

Read the latest Blogs

Forums

The Max PK Length

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Max PK Length

My experience using the GitHub Copilot in SSMS 22

By Daniel Calbimonte

Comments posted to this topic are about the item My experience using the GitHub...

The Microsoft SQL Year in Review

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Microsoft SQL Year in...

Visit the forum

Question of the Day

The Max PK Length

If I create a multiple column Primary Key constraint, what is the most number of bytes I can include in the constraint?

See possible answers