MS Access/SQL Server 2008 R2- nvarchar(max) to nvarchar(50)

Hi Experts,

I have a table that has max (Memo)

so when I try to link to that column I get an error:
Cannot join on Memo, OLE, or Hyperlink Object

Looks like I need to basically copy this table and change the max to around 50

So just taking the columns I need like:
SELECT [txtID]
      ,[CountryOfService]
      ,[StateProvinceOfService]
  FROM [SIOP_siophal].[dbo].[vwConsultants]

Open in new window


And doing a InTo
SELECT [txtID]
      ,[CountryOfService]
      ,[StateProvinceOfService]
InTo  [SIOP_siophal].[dbo].[cnv_vwConsultants]
  FROM [SIOP_siophal].[dbo].[vwConsultants]

Open in new window


But I will need help with converting it from max to 50
Something like:
Left (CountryOfService), 50

I would like to do this in TSQL

Please help and thanks....
Amour22015Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
What platform are you on? It sounds like a mix of Access and SQL, but it's hard to say.

Is CountryOfService a Text field on the server? Given the name, I'd seriously doubt it (but could be wrong).
Amour22015Author Commented:
thanks,


I can do this on SQL then bring it into Access, so the converting would be done in SQL (TSQL)

When I open the Columns it shows:
varchar(max) on the column.

I need to create another table taking the Left of that column and making it a smaller column
and as you can see it is a country name.   Don't know why the creator made this a Max column.

Please help and thanks....
Amour22015Author Commented:
So I am looking to do this:
Changing a data column from nvarchar(max) to nvarchar(50) in SQL Server 2008

There most be a simple way of doing this?

I have already created the other table with just the columns I need.  Maybe ALTER but would have to do a Left on the column?

Please help and thanks....
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Amour22015Author Commented:
Looks like all I had to do is this:
ALTER TABLE [SIOP_siophal].[dbo].[cnv_vwConsultants] ALTER COLUMN [CountryOfService] nvarchar(50)

This seems to work...

Thanks

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Sounds good! Be sure to accept your own comment as the solution.
Amour22015Author Commented:
So how do I do that?  Plus I don't want any points, but this maybe helpful to others.
Amour22015Author Commented:
Found solution
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.