Skip to content

Instantly share code, notes, and snippets.

@jessenaiman
Last active August 29, 2015 14:01
Show Gist options
  • Save jessenaiman/164fec77cf55e1cd2bb1 to your computer and use it in GitHub Desktop.
Save jessenaiman/164fec77cf55e1cd2bb1 to your computer and use it in GitHub Desktop.
DELETE FROM [Catalyst.Models.DataContext].[dbo].[transactions]
WHERE id = '36833'
GO
DELETE FROM [Catalyst.Models.DataContext].[dbo].[items]
WHERE id = '36833'
GO
select reference, count(*) totalCount
from transactions
group by reference
having count(*) > 1
SELECT TOP 1 *
FROM transactions
where reference = '2014051514400007657'
@jessenaiman
Copy link
Author

/****** Script for SelectTopNRows command from SSMS  ******/
SELECT TOP 1000 [id]
      ,[prefix]
      ,[first_name]
      ,[last_name]
      ,[street_address]
      ,[postal_code]
      ,[city]
      ,[telephone]
      ,[email]
      ,[card_name]
      ,[card_security]
      ,[card_expiry]
      ,[card_reference]
      ,[card_type]
      ,[personal]
      ,[company_name]
      ,[user_ip]
      ,[origin_url]
      ,[target_url]
      ,[promo_code]
      ,[gateway_response]
      ,[riding_id]
      ,[home_riding]
      ,[type]
      ,[comments]
      ,[complete]
      ,[reference]
  FROM [catalyst].[dbo].[transactions]
  where reference = ''

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment