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

140 reads

Blogs

Tomorrow: Webcast on SQL Server security

By

Tomorrow, April 16, 2024, I will be giving another webcast; this one will be...

A New Word: the Wends

By

the wends– n. the frustration that you’re not enjoying an experience as much as...

7 Best Online Advanced SQL Training Courses to Learn in 2024 and Beyond

By

The world runs on data, and SQL is the key to unlocking its secrets....

Read the latest Blogs

Forums

Expression Error ( property 'Error' cannot be selected )

By rjdineen

Hello there. I have the following Pipeline I want to get the property error...

create cluster fails Win2016.

By snomadj

I'm installing a cluster prior to my 2019 SQL build.   Failover Cluster tools...

Dependency Cycle in Database with Update Approvals

By ahlembreath

I'm struggling with a dependency cycle in my SQL database schema. Here's the situation:...

Visit the forum

Question of the Day

Express In-Memory OLTP

Can I create In-Memory OLTP tables in SQL Server Express?

See possible answers