Solved

sql 2008 create view b using linkes server

Posted on 2011-09-16
7
352 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:shanj
  • 3
  • 3
7 Comments
 
LVL 6

Expert Comment

by:dan_mason
ID: 36548603
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
 
LVL 6

Expert Comment

by:dan_mason
ID: 36548719
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
 

Author Comment

by:shanj
ID: 36548882
hi dan!
  problem is not linked servers.
i want to create a view with collation via a linked server is the problem.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:shanj
ID: 36548915
dan the create view gave me the same error-.
Incorrect syntax near the keyword 'COLLATE'.
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 36549005
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
 
LVL 6

Expert Comment

by:dan_mason
ID: 36549115
Yep, thanks angelIII : precisely what I meant to write! Stupidly I didn't spot the "as" in the code.
0
 

Author Closing Comment

by:shanj
ID: 36553686
thanks angelll  it worked
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question