Solved

sql 2008 create view b using linkes server

Posted on 2011-09-16
7
353 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
In this article I will describe the Copy Database Wizard 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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

738 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