user2589824
user2589824

Reputation: 19

SSRS : Column name with Special Characters like $

I have a stored procedure which i am using in SSRS to get DATA SET. it has some column name containing "(",")","$" etc. i can run the SP in sql server. but Refresh Field gives error as "the query contains more than one unnamed or duplicate field name". I am sure that there is not such column.

Upvotes: 1

Views: 3529

Answers (1)

Ian Preston
Ian Preston

Reputation: 39606

The issue is due to the columns [INCUR COST$] and [INCUR COST£] (at least based on the details you provide).

SSRS will not allow special characters like , $ and £ for its Dataset columns, but it will happily try to transform any query columns into an accepted name by replacing with _ where possible.

In your case, [INCUR COST$] and [INCUR COST£] both transform to INCUR_COST_, hence your error with duplicate field names.

To create a simple test you can create a Dataset with the following query:

select [Incur Cost$] = 1

SSRS does this without error. You will get an error with:

select [Incur Cost$] = 1, [Incur Cost£] = 1

enter image description here

At this stage you get an option to update the names:

enter image description here

Update as necessary.

As a workaround you could create more standardised names in your SP (this is really the best practice option) or you can manually add fields to your Dataset in BIDS, where you can specify the Dataset name to your liking, taking into account SSRS naming limitations.

Upvotes: 3

Related Questions