locked
Unable to migrate db to Azure SQL - Incorrect syntax RRS feed

  • Question

  • I have a really weird situation. I'm running Data Migration Assistant to assess the possibility of migrating my db to Azure SQL. However, I keep getting the following error:

    I think the problem is that my column name is "Url" but I don't see this in the list of reserved keywords for SQL. Here are the contents of the SP in question. If I comment out the first "Insert" statement, then the migration assistant no longer finds any error.

    ALTER Procedure [dbo].[UserPageLogAdd_P]
    @UserID [int],
    @Url [nvarchar](4000)
    As
    Begin
    	
    		Insert Into UserApiLog (UserID,Url)
    		Values (@UserID,@Url)
    
    		Update UsersExtraData Set OnlineYN=1,LastActivities =GETDATE() Where UserID=@UserID
    
    		if @@rowcount=0 
    		begin
    			insert into UsersExtraData (UserID,OnlineYN,LastActivities) select @UserID , 1 , getdate()
    		end	
    
     
    End

    What can I do to resolve this? Why would I get an error simply if a column name is "Url"?


    • Edited by noamo48 Tuesday, August 27, 2019 3:01 PM
    Tuesday, August 27, 2019 2:46 PM

All replies

  • Hi Noama48,

    Can you try nvarchar(max) 

    If you use nchar or nvarchar, we recommend to:

    • Use nchar when the sizes of the column data entries are consistent.
    • Use nvarchar when the sizes of the column data entries vary considerably.
    • Use nvarchar(max) when the sizes of the column data entries vary considerably, and the string length might exceed 4,000 byte-pairs.

    See: nchar and nvarchar (Transact-SQL)

    Regards,

    Mike


    Tuesday, August 27, 2019 10:32 PM
  • Tried this, but it still flags it for the same error.
    Thursday, August 29, 2019 8:12 PM
  • Do you have an Azure Support Plan? If so, can you please have a support request created to look at this more thoroughly. If you do not have an Azure support plan, can you please send your Subscription ID to AzCommunity and instructions will be return to have a one-time support request created.

    Regards,

    Mike

    Monday, September 2, 2019 8:15 PM