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 […]

2003-05-10

138 reads

Blogs

Daily Coping 3 Feb 2023

By

Today’s coping tip is to ask other people about things they’ve enjoyed recently I...

Daily Coping 2 Feb 2023

By

Today’s coping tip is to challenge negative thoughts and look for the upside. I’m...

Deadline for Microsoft MVP contributions is 20 March 2023

By

Since changing to the new MVP renewal model, Microsoft MVPs have had until 31...

Read the latest Blogs

Forums

Re-creating AG after server loss

By izinger

We recently had to rebuild servers that were configured with AG. I built everything...

Cannot run DynamicSQL Statement to merge table with JSON

By Weegee71

Hi there I have a problem with a dynamicSQL Statement. In this code, I...

find connection details for all ssis jobs

By Bhagat

Hi, is there are way using sql that brings a list of the ssis...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers