'The identifier that starts with ...... is too long. Maximum length is 128

I am shifting my database to MS SQL Server 2008 R2, When I am trying to save long length string then it is giving me the error for Maximum length, while i have set the datatype of that column as "text" after it i replaced it with "varchar(max)" but no solution there.

kindly provide me a solution how to resolve this issue. I am executing the following query:

update hotel 
set hotel_policy = 
    "Overview of Park Central New York - New York
    This hotel is making improvements.
        The property is undergoing renovations. The following areas are affected:
        Bar/lounge
        Business center
        Select guestrooms

    Every effort will be made to minimize noise and disturbance.
    Occupying a Beaux Arts building dating to 1927, Park Central New York Hotel is within a block of famed concert venue Carnegie Hall and within a 5-minute walk of Manhattan’s world-renowned Broadway theater district. Prefer the great outdoors to the Great White Way? Central Park is just 3 blocks from the hotel. There, you can rent a rowboat at the lake, play a game of tennis, or visit the Central Park Zoo. The international boutiques and flagship department stores of Fifth Avenue start within a 10-minute walk of the hotel. For travel to sights farther afield, there are 7 subway lines located within 3 blocks of the Park Central.
    The hotel has a snack bar for guests' convenience, and coffee and tea in the lobby.
    Retreat to your guestroom and sink into a bed with a pillowtop mattress and down comforter and pillows. Need to check email or finish up some work? You’ll find a desk with an ergonomic chair and wireless high-speed Internet access (surcharge). Unwind with a video game (surcharge) on the flat-panel HDTV."

where hotel_id = 1

I search it a lot but the solutions i found are not useful to me.

Thanks!



Solution 1:[1]

If you don't want to change double quotes to single quotes add following two lines in the begging of the script

 SET QUOTED_IDENTIFIER OFF
 SET ANSI_NULLS ON 

Solution 2:[2]

 [ UPDATE denomination SET currencyType ='COINS', denomination ='1.00', currencyValue='3CAD', Active ='N', UPDATEDBY ='EBIX_ADMIN', UPDATEDDATE =GETDATE() WHERE groupId ='EXC' AND COUNTRYCODE ='CA' AND currencyCode ='CAD' AND denomination ='1.00' , UPDATE denomination SET currencyType ='COINS', denomination ='1.00', currencyValue='2CAD', Active ='N', UPDATEDBY ='EBIX_ADMIN', UPDATEDDATE =GETDATE() WHERE groupId ='EXC' AND COUNTRYCODE ='CA' AND currencyCode ='CAD' AND denomination ='1.00' , UPDATE denomination SET currencyType ='COINS', denomination ='1.00', currencyValue='2', Active ='Y', UPDATEDBY ='EBIX_ADMIN', UPDATEDDATE =GETDATE() WHERE groupId ='EXC' AND COUNTRYCODE ='CA' AND currencyCode ='CAD' AND denomination ='1.00' , UPDATE denomination SET currencyType ='NOTES', denomination ='7.00', currencyValue='8', Active ='N', UPDATEDBY ='EBIX_ADMIN', UPDATEDDATE =GETDATE() WHERE groupId ='EXC' AND COUNTRYCODE ='CA' AND currencyCode ='CAD' AND denomination ='7.00' , UPDATE denomination SET currencyType ='NOTES', denomination ='10.00', currencyValue='TENCAD', Active ='Y', UPDATEDBY ='EBIX_ADMIN', UPDATEDDATE =GETDATE() WHERE groupId ='EXC' AND COUNTRYCODE ='CA' AND currencyCode ='CAD' AND denomination ='10.00' , UPDATE denomination SET currencyType ='NOTES', denomination ='20.00', currencyValue='TWENTYCAD', Active ='N', UPDATEDBY ='EBIX_ADMIN', UPDATEDDATE =GETDATE() WHERE groupId ='EXC' AND COUNTRYCODE ='CA' AND currencyCode ='CAD' AND denomination ='20.00' ] 

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Toren
Solution 2 Suraj Rao