my code stock.com

Snippet options

Download: Download snippet as check_database_columns.sql.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

set nocount on 

create table ##check_database_columns (
	table_qualifier sysname,
	table_owner sysname,
	table_name sysname,
	column_name sysname,
	data_type smallint,
	type_name sysname,
	[precision] int,
	length int,
	scale smallint,
	radix smallint,
	nullable smallint,
	remarks varchar(254),
	column_def nvarchar(4000),
	sql_data_type smallint,
	sql_datetime_sub smallint,
	char_octet_length int,
	ordinal_position int,
	is_nullable varchar(254),
	ss_data_type tinyint
)

exec sp_MSforeachtable @command1 = '
	declare @@tmp nvarchar(500)
	set @@tmp = object_name(object_id(''?''))
	insert into ##check_database_columns exec sp_columns @@tmp
'

select * from ##check_database_columns

drop table ##check_database_columns

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.