0

Hi all,

DANIWEB saved me a few months ago, and I'm hoping the community can save me again :)

I've found myself in the position of needing to extract a very small portion of data from a vast SQL database.

I've got the specific table in question, and have isolated what was needed out of the query itself.

However, my problem is this:

When I run the query

SELECT TOP 100000 [typeID]
      ,[groupID]
      ,[typeName]
      ,[description]
      ,[graphicID]
      ,[radius]
      ,[mass]
      ,[volume]
      ,[capacity]
      ,[portionSize]
      ,[raceID]
      ,[basePrice]
      ,[published]
      ,[marketGroupID]
      ,[chanceOfDuplicating]
      ,[iconID]
  FROM [ebs_DATADUMP].[dbo].[invTypes]

I get a whole host of entries in some fields that have a NULL entry, specifically the marketgroupID column. I need an amendment to the script that would behave like:

if [marketGroupID]=NULL then Ignore_Row

And (yes, and) if [typeName] has the word "Blueprint" in it, to also ignore that row.

I realise this might be a bit much to ask, but any help or guidance will be massively appreciated.

Regards

Rob.

1
Contributor
2
Replies
3
Views
6 Years
Discussion Span
Last Post by CCISolitude
0

I've now amended my own script to this point:

SELECT TOP 100000 [typeName]
      ,[volume]
      ,[marketGroupID]
      ,[iconID]
  FROM [ebs_DATADUMP].[dbo].[invTypes]
  delete from [ebs_DATADUMP].[dbo].[invTypes]
  where ebs_datadump.dbo.invTypes.marketGroupID='NULL'

But I'm getting this error:

Conversion failed when converting the varchar value 'NULL' to data type smallint.

Now this would be due to the marketGroupID being an integer field, but how do I quantify a null entry in an integer?

Rob

0

aaah

sorted it, had the wrong end of the stick syntax wise,

where ebs_datadump.dbo.invTypes.marketGroupID is NOT NULL

Success!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.