sql 2008 create view b using linkes server

CREATE VIEW [dbo].[apple]
as
    select
        xx.ProdNo as productNo,
        xx.Descr as Descr
   from server.Mydatabase.dbo.AllProd xx
    COLLATE Danish_Norwegian_CI_AS ASC;
GO
I get the following error "Incorrect syntax near the keyword 'COLLATE'."

Create view thru a LINKED SERVER
shanjAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
what about:
CREATE VIEW [dbo].[apple] 
as
    SELECT
        xx.ProdNo COLLATE Danish_Norwegian_CI_AS as productNo ,
        xx.Descr COLLATE Danish_Norwegian_CI_AS as Descr 
   FROM server.Mydatabase.dbo.AllProd xx
 GO

Open in new window

0
 
dan_masonCommented:
What about this?
CREATE VIEW [dbo].[apple] 
as
    SELECT
        xx.ProdNo as productNo COLLATE Danish_Norwegian_CI_AS,
        xx.Descr as Descr COLLATE Danish_Norwegian_CI_AS
   FROM server.Mydatabase.dbo.AllProd xx
 GO

Open in new window

0
 
dan_masonCommented:
The setting up a linked server is not too hard, by the way. Using SQL Server Management Studio, in the Object Explorer, right-click Server Objects, select New, and select Linked Server. The boxes are fairly self-explanatory hopefully, but let us know if you need further advice.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
shanjAuthor Commented:
hi dan!
  problem is not linked servers.
i want to create a view with collation via a linked server is the problem.
0
 
shanjAuthor Commented:
dan the create view gave me the same error-.
Incorrect syntax near the keyword 'COLLATE'.
0
 
dan_masonCommented:
Yep, thanks angelIII : precisely what I meant to write! Stupidly I didn't spot the "as" in the code.
0
 
shanjAuthor Commented:
thanks angelll  it worked
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.