Skip to content

Instantly share code, notes, and snippets.

@lppier
Created March 14, 2019 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lppier/f416c654493d3668b88898b73f677ea6 to your computer and use it in GitHub Desktop.
Save lppier/f416c654493d3668b88898b73f677ea6 to your computer and use it in GitHub Desktop.
Useful SQL for table handling
-- Remove all backup tables
DROP TABLE IF EXISTS [WKBRZ].[dbo].[PredictionNetworkBookingPax_Backup];
-- Create a backup
select * into [WKBRZ].[dbo].[PredictionNetworkBookingPax_Backup] from [WKBRZ].[dbo].[PredictionNetworkBookingPax]
-- Restore from the backup tables
INSERT INTO [WKBRZ].[dbo].[PredictionNetworkBookingPax] SELECT * FROM [WKBRZ].[dbo].[PredictionNetworkBookingPax_Backup]
-- Delete all prediction table contents
DELETE FROM [WKBRZ].[dbo].[PredictionNetworkBookingPax]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment