January 8, 2009 at 9:25 am
I'm doing a simple variable assignment from a "between quotes" text to nvarchar and I keep getting the following error:
Msg 257, Level 16, State 3, Line 1
Implicit conversion from data type ntext to varchar is not allowed. Use the CONVERT function to run this query.
This is what I'm doing:
Declare @Outputfile nvarchar(128)
Select @OutPutFile='D:\Temp\ProfilerDailySnapshot\'
I have tried to use cast and convert but the problem still remains.
I have tried the following:
Select @OutPutFile=Cast('D:\Temp\ProfilerDailySnapshot\' as nvarchar(128)
also --> Select @OutPutFile=Convert(nvarchar(128), 'D:\Temp\ProfilerDailySnapshot\' )
I'm running SQL 2000 (by the way). This same code works fine on sQL 2005.
any ideas?
Thank you much!
January 8, 2009 at 9:32 am
Paul Perez (1/8/2009)
I'm doing a simple variable assignment from a "between quotes" text to nvarchar and I keep getting the following error:Msg 257, Level 16, State 3, Line 1
Implicit conversion from data type ntext to varchar is not allowed. Use the CONVERT function to run this query.
This is what I'm doing:
Declare @Outputfile nvarchar(128)
Select @OutPutFile='D:\Temp\ProfilerDailySnapshot\'
I have tried to use cast and convert but the problem still remains.
I have tried the following:
Select @OutPutFile=Cast('D:\Temp\ProfilerDailySnapshot\' as nvarchar(128)
also --> Select @OutPutFile=Convert(nvarchar(128), 'D:\Temp\ProfilerDailySnapshot\' )
I'm running SQL 2000 (by the way). This same code works fine on sQL 2005.
any ideas?
Thank you much!
Have you tried this:
Declare @Outputfile nvarchar(128)
Select @OutPutFile = N'D:\Temp\ProfilerDailySnapshot\'
January 8, 2009 at 9:44 am
Sorry...as soon as I posted this thing...I figured out what the problem was. It had nothing to do with the assignment I was looking at. It had to do with an insert I was doing at the end of proc. I was inserting ntext data into a varchar field and SQL was simply that it could not do that. I use the convert function on my insert statement and fixed that.
Sorry about that! thank a lot for your quick response!
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy