Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server references (not a database reference) in DB Projects

I have an issue regarding a DB project in VS 2013. Where I am using, for example, OPENQUERY([Server.IP],'blah blah'), the server name will always return a warning. E.g.

"Procedure [dbo].[xxx] has an unresolved reference to object [server.IP]".

Is it possible to remove these errors?

like image 376
gsweet87 Avatar asked Aug 09 '26 12:08

gsweet87


1 Answers

You have to define the linked server in your project.

Just add a New Item of Linked Server type to your project and then put the linked server definition in it. For example:

/****** Object:  LinkedServer [Server.IP]    Script Date: 30/07/2014 16:17:56 ******/
EXEC dbo.sp_addlinkedserver @server = N'Server.IP', @srvproduct=N'SQL Server'
GO
 /* For security reasons the linked server remote logins password is changed with ######## */
EXEC dbo.sp_addlinkedsrvlogin @rmtsrvname=N'xxx.xxx.xxx.xxx',@useself=N'True',@locallogin=NULL,@rmtuser=NULL,@rmtpassword=NULL
like image 187
lucazav Avatar answered Aug 12 '26 14:08

lucazav



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!