Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Comparing Table Structures
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01506130
Message ID:
01506144
Vues:
59
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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform