2 Replies - 555 Views - Last Post: 27 April 2017 - 05:18 PM Rate Topic: -----

#1 Damage  Icon User is offline

  • Lord of Schwing
  • member icon

Reputation: 284
  • View blog
  • Posts: 1,961
  • Joined: 05-June 08

Error when specifying column names

Posted 26 April 2017 - 02:39 PM

Just came across something (that i think is) superweird

doing a quick and dirty datacheck

This query executes

select * from gasset_master A
inner join passed$ B
ON A.G1_ASSET_GROUP = B.assetgroup
and A.G1_ASSET_TYPE = B.AssetType
And A.G1_ASSET_ID = B.AssetId


BUT
this one fails (only difference is I'm specifying a column name)

select A.G1_ASSET_SEQ_NBR from gasset_master A
inner join passed$ B
ON A.G1_ASSET_GROUP = B.assetgroup
and A.G1_ASSET_TYPE = B.AssetType
And A.G1_ASSET_ID = B.AssetId



(it fails with a data conversion error "Error converting data type nvarchar to float.")

This post has been edited by modi123_1: 26 April 2017 - 02:40 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Error when specifying column names

#2 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 4136
  • View blog
  • Posts: 13,057
  • Joined: 08-June 10

Re: Error when specifying column names

Posted 27 April 2017 - 12:13 AM

Quote

it fails with a data conversion error "Error converting data type nvarchar to float."

Is that a database error or an error of the calling language? if the former, what database?
Was This Post Helpful? 0
  • +
  • -

#3 Damage  Icon User is offline

  • Lord of Schwing
  • member icon

Reputation: 284
  • View blog
  • Posts: 1,961
  • Joined: 05-June 08

Re: Error when specifying column names

Posted 27 April 2017 - 05:18 PM

Ah sorry, it's TSQL running on a database sitting on SQL Server 2012
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1