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

THAT Conference 2024 in Wisconsin Dells

By

I’m headed back to Wisconsin Dells next week for THAT! Conference 2024. This is...

7 Best Online Advanced SQL Training Courses to Learn in 2024

By

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

Calling a REST Endpoint from Azure SQL DB

By

External REST endpoint invocation in Azure SQL DB went GA in August 2023. Whereas...

Read the latest Blogs

Forums

Issues adding and updating a column

By richardmgreen1

Hi all   I'm hoping someone will able to say "you're an idiot because....."...

Deadlocks with UPDATE statements using serializable transaction isolation level

By zoggling

We are seeing frequent deadlocks occurring due to a particular stored procedure that is...

Use Polybase with ODBC to create external table

By blom0344

I'm trying to use the installed Polybase service on an  SQL 2019 server to...

Visit the forum

Question of the Day

The Last DBCC Date

How can I easily get the last DBCC CheckDB date from T-SQL in SQL Server 2022?

See possible answers