How to Create a Quick Table Backup using T-SQL

–OPTIONALLY CHECK FOR AND DROP THE BACKUP TABLE IF ALREADY EXISTS:
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[MY_TABLE_BACKUP_20130710]’) AND type in (N’U’))
DROP TABLE [MY_TABLE_BACKUP_20130710]
GO

–ONE LINE TABLE BACKUP:
SELECT * INTO [MY_TABLE_BACKUP_20130710] FROM [MY_ORG_TABLE]
GO
–NOTE THIS COPIES JUST DATA, NOT CONSTRAINTS OR RELATIONS

Advertisements

Umbraco SQl to Find Nodes using a Certain Document Type

SELECT * FROM cmsContent C
INNER JOIN cmsContentType CT ON C.contentType = CT.nodeId
INNER JOIN umbracoNode N ON C.nodeId = N.id
WHERE CT.alias = ‘yourDocumentTypeAliasHere’

–use the node path to locate nodes in Umbraco