Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Comparing Table Structures
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01506130
Message ID:
01506144
Views:
58
You can use following query to get info about all columns for specified table
SELECT  *
	FROM sys.columns
	WHERE [object_id] = object_id('Table Name')
>I'm writing a stored procedure to archive data into archive tables. As a safety mechanism I would like to ensure that the source table and the archive table have the exact same structure (ensuring that a change wasn't made in one and not the other). Anyone know how to compare table structures in a stored procedure and fail the stored procedure if the tables do not match?
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform