Select relevant Database
Change table from customer to whatever table name you need
Execute
Then use the result to generate the parameter list for your SP
Thomas,
2009-12-04 (first published: 2009-11-10)
Select relevant Database
Change table from customer to whatever table name you need
Execute
Then use the result to generate the parameter list for your SP
select '@' + c.name, col_definition = case t.name when 'bigint' then 'bigint,' when 'int' then 'int,' when 'smallint' then 'smallint,' when 'tinyint' then 'tinyint,' when 'bit' then 'bit,' when 'decimal' then 'decimal,' when 'numeric' then 'numeric,' when 'money' then 'money,' when 'smallmoney' then 'smallmoney,' when 'float' then 'float,' when 'real' then 'real,' when 'datetime' then 'datetime,' when 'smalldatetime' then 'smalldatetime,' when 'sql_variant' then 'sql_variant,' when 'timestamp' then 'timestamp,' when 'uniqueidentifier' then 'uniqueidentifier,' when 'xml' then 'xml,' else t.name + '(' + cast(c.prec as varchar(50)) + '),' end from sysobjects s inner join sys.syscolumns c on s.id = c.id inner join sys.types t on t.user_type_id = c.xtype where s.xtype='U' and s.name = 'customer'
2010-10-19
4,313 reads
Use this script to search for SQL Server logins who use weak password
2010-01-05 (first published: 2009-12-16)
4,052 reads
Searches for objects (including CLR) who's names contain the search string. outputs IDs, names, and types of the object and its parent.
2009-10-06 (first published: 2009-09-22)
1,150 reads
The second of a series by Paul White examining the APPLY operator. In this section learn how this operator compares with joins and about both the cross and outer options.
2012-01-13 (first published: 2010-04-19)
26,243 reads
A tip from MSSQLTips that shows a few ways for implementing paging on large tables.
2009-03-12
5,878 reads