How to Display a Customer Name in SQL dbo.Customer?

5 months ago
NC 3.90

There are some fake registrations. I would like to delete them in bulk.

Also there are a lot of real customers' accounts mixed with fake ones.

So in order not to get confused and delete fake registrations, I need to see a Customer Name like in admin /Admin/Customer/List, but in SQL dbo.Customer table.

How can I do it in MSSQL Server 2014 Management Studio?


***********************************************************


Thanks.
5 months ago
FirstName and LastName are in the GenericAttribute table
use this query  to find
SELECT  c.[Id]
      ,[CustomerGuid]
      ,[Username]
      ,ISNULL(FirstName.Value, '') + ' ' + ISNULL(LastName.Value, '') AS FullName
      ,[Email]
      ,[EmailToRevalidate]
      ,[AdminComment]
      ,[IsTaxExempt]
      ,[AffiliateId]
      ,[VendorId]
      ,[HasShoppingCartItems]
      ,[RequireReLogin]
      ,[FailedLoginAttempts]
      ,[CannotLoginUntilDateUtc]
      ,[Active]
      ,[Deleted]
      ,[IsSystemAccount]
      ,[SystemName]
      ,[LastIpAddress]
      ,[CreatedOnUtc]
      ,[LastLoginDateUtc]
      ,[LastActivityDateUtc]
      ,[RegisteredInStoreId]
      ,[BillingAddress_Id]
      ,[ShippingAddress_Id]
  FROM [dbo].[Customer] c
  LEFT JOIN GenericAttribute FirstName
    ON c.Id = FirstName.EntityId AND FirstName.KeyGroup = 'Customer' AND FirstName.[Key] = 'FirstName'
  LEFT JOIN GenericAttribute LastName
    ON c.Id = LastName.EntityId AND LastName.KeyGroup = 'Customer' AND LastName.[Key] = 'LastName';



//Rashed