Using Linked SQL server in a View

Hello All:
    I have a new view that reads data from the base source server/table.   Also, it links in another server (using the sp_addlinkedserver command).
When I run the script not in a view, it works.   When I create a view with this script, it does not find the linked server.   Is there some issue with linked servers from within a view or perhaps I am creating the view
incorrectly in combination with the linking of the server?   I have begining of the view creation below.   Ideas?    Thanks
If OBJECT_ID('dbo.V_CombinedLaborHours') IS NOT NULL
    DROP VIEW dbo.V_CombinedLaborHours;
GO
use SQL_Server_1
EXEC sp_addlinkedserver 'SQL_Server_2', N'SQL Server'
GO
Create View dbo.V_CombinedLaborHours
AS
select

Sorry, that difference in the name was a typo.   I manually changed the name for display purposes only.   My company forbids actual server and database names to be exposed to the outside.  
When I run the script from outside of the view, it works (linking the second server etc) and I can see the data coming from the view.   It is just when I create the view (as shown in the first entry in this thread) then it is as if the view is
not running the sp_addlinkedserver command.
Perhaps I cannot run the link to the second server out side of the "AS" command?   I tried having it inside of the "AS" but then it throws error.  When I look at the definition of the View it is not showing the link to
the second server as if it got ignored during the create of the view.

Similar Messages

  • Use a SQL SERVER get date in query

    I want to constrain my returned data by a change date to just return the last rolling 30 days of data. When I use sysdate, I find the plan is to retreive ALL data across the dblink, and then filter it on the Oracle side.
    Is there any way I can use the Sql Server getdate() function, something like
    select * from remote@ss_link
    where upd_date >= getdate() - 30
    Problem - how do I get Oracle to pass the Sql Server specific function call to Sql Server? [BTW I'm on an old version of Oracle...]

    It depends on the product you are using.
    If you are using a gateway you can call remote functions using the getdate@<db link> syntax as described in the Heterogeneous Admin Guide.
    For gateways and generic connectivity you can also use PASSTHROUGH which allows you to pass a statement as it is to the remote database.
    Or at least you can create a view at the SQL Server side which returns the last 30 days and then just select from this view.

  • Using the SQL Server Agent for the first time

    I have set up several jobs to run automatically throughout the day. Each job just does one thing: executes an SSIS package.
    The packages themselves run perfect when I test them in Visual Studio 2005, but when the SQL Server Agent tries to run the job I am getting failed jobs.
    Is there any tutorials or walkthroughs that can teach my about using the SQL Server Agent? If I wanted extensive help troubleshooting my SQL Server Agent problems which part of the message boards would I post that too?
    Thanks for the info!

    Anyone?
    I really need some resources for SQL Server Agent 2005.
    Refer these links,
    http://technet.microsoft.com/en-us/library/ms141701(v=sql.90).aspx
    http://stackoverflow.com/questions/10489392/permissions-issue-running-ssis-package-from-sql-job
    Regards, RSingh

  • Features No longer used from Sql Server 2005 to 2008 R2

    As part of our Migration process from 2005 to 2008 R2, which Specific features should i be taking into consideration in Upgrade to Sql Server 2008 R2 in prespective of T-Sql queries already written in 2005 and need to be changed to 2008 r2 compatibility.Thanks!
    Srikanth

    According to the Link, SET ROWCOUNT function has to be replaced with TOP keyword , but SET ROWCOUNT is still used in SQL Server 2008 R2 and its later versions according to microsoft :
    http://msdn.microsoft.com/en-us/library/ms188774.aspx 
    Can anyone help me in this regard.Thanks!
    If you read further below there is a note mentioned as
    Using SET ROWCOUNT will not affect DELETE, INSERT, and UPDATE statements in a future release of SQL Server. Avoid using SET ROWCOUNT with DELETE, INSERT, and UPDATE statements in new development work, and plan to modify applications that currently use it.
    For a similar behavior, use the TOP syntax. For more information, see TOP (Transact-SQL).
    MS cannot remove it completely knowing to fact that we are Lazy and will not immediately change our code :)
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • How to populate a spry menu using microsoft sql server database?

    Hi
    I would like to use dreamweaver cs4 and spry menu to create a dynamically created menu system.
    My concept is to populate the menu items on the fly using MS sql server as the database technology.
    Can anyone point me in the right direction? I have googled and searched but cant seem to get anywhere.
    Also once i get my menu established, i would like to style it. It seems like a lot of work to style each element by hand. I was wondering if there were some collection of spry menu css files somewhere that i could just attach and presto!
    Thank you.
    Jerry

    I would like to use dreamweaver cs4 and spry menu to create a dynamically created menu system. My concept is to populate the menu items on the fly using MS sql server as the database technology.
    Basically
    create a dynamic XML file containing data from the database
    create A SpryXMLDataSet
    create a SpryRegion where the menu appears
    using SpryRepeat populate the menu
    More info can be found here http://labs.adobe.com/technologies/spry/samples/
    Also once i get my menu established, i would like to style it. It seems like a lot of work to style each element by hand. I was wondering if there were some collection of spry menu css files somewhere that i could just attach and presto!
    Have a look here http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=2141544
    If you require further Spry related support go to http://forums.adobe.com/community/labs/spry

  • Problem using MS SQL Server JDBC Driver

    I am trying to use MS SQL Server JBDC driver with JDeveloper9i. I followed the steps mentioned in the document
    http://otn.oracle.com/products/jdev/howtos/bc4j/bc_psqlserverwalkthrough.html
    Still I am getting the following error message
    Error initializing data-source 'SQLTestDS': DriverManagerDataSource driver 'com.microsoft.jdbc.sqlserver.SQLServerDriver' not found
    What could be the reason?Did anybody run into similar issue?
    Thanks in advance.
    RC

    I assume from your message that you are attempting to
    deploy your application into OC4J - you're probably
    implicitly using the inbuilt OC4J if your using JSPs.
    If so, try placing the jdbc jars into the <JDEVHOME>\lib directory
    and referencing them from the j2ee\home\application.xml
    file:
    use lines like:
    <library path="../../../lib/msbase.jar" />
    regards, Karl

  • Query used by SQL Server Management Pack for monitoring database backups

    I use SCOM 2012 R2 and the SQL Server Management Pack to monitor SQL Server database backups. I believe I am getting false positives. SCOM reports database are not backuped, while in fact they are. So I need to troubleshoot this. I suspect SCOM is querying
    the backup history in the msdb database. I want to know which query SCOM uses.
    I have tried looking in the monitor's definition but I suspect the query is embedded in the management pack files which are binary. I have also tried running a trace using the SQL Server Profiler on my test environment and overriding the interval to 60 seconds,
    but I don't see a relevant query being executed. I also don't see the alert reappear so I suspect SCOM does not honor the interval in a way I would expect.
    What query, or other method, does SCOM use to check database backups?
    Thanks in advance.

    Thank you both Ivan and Michael,
    I only saw your messages by email and didn't see your screen shot before I extracted the query myself. In my own queries I calculate the backup age in hours instead of days because of daily full backups. Perhaps It will be a good idea to create my own monitors
    from scratch like I used to do with Nagios.
    I will study the vbscripts and might create my own version which allows the query to be entered as an parameter and move all code to a .Net class which can be called from vbscript as an COM object. This way I hope to reduce the vbscript code to an minimum
    while keeping the flexibility of the SCOM Operations Console and the robustness of .Net. I suspect I want to make more non standard monitors in the future.
    Regards,
    Arjen

  • Error Using the SQL Server 2000 Driver for JDBC Service Pack 3

    Hi,
    I�m using the SQL Server 2000 Driver for JDBC Service Pack 3. The connection is succesfully, but when I use de statement.executequery() method, there is the follow exception:
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'PEC_COUNTRY'.
    This is my code:
    ResultSet resultSet;
    Statement statement;
    Connection connection;
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
    connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://S0MALMUERTA:1433;user=sa;password=");
    statement = connection.createStatement();
    resultSet = statement.executeQuery("SELECT COY_INX, COY_NAME, COY_ICO FROM PEC_COUNTRY
    ");When I make the last instruction, occurs the above exception
    Thanks in advance
    Luija

    The way you are connecting, the default database used will be 'master' and i guess that the table PEC_COUNTRY was defined in another database.
    If it is the case you need to specify the database name.
    connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://S0MALMUERTA:1433;DatabaseName=yourdb;user=sa;password=");

  • Using MS Sql Server 2000 with Flex 2

    help! - I'm trying to understand how I could use Flex 2 (with
    the Flex Data Services) using MS SQL Server 2000 as my RDMS.
    Currently using SS with ASP. Basically, what do I need in
    terms of server set up (e.g. do I need to install the J2EE Server
    for instance?). How about using transaction based storedprocedures
    with flex.
    I'm having difficulty finding a clear answer (for me anyway!)
    to my question. I have even phoned Adobe last Thursday to ask them
    - and their expert was not around and they said would call me
    back... hmm.

    Hi Michael,
    At this time SQL Server 2000 is not certified for WLCS 3.5. Since the
    schema has changed between 3.2 and 3.5, running the 3.2 scripts is not a
    good idea.
    I can tell you that certification is in progress for SQL Server 2000. Your
    best bet is to contact your Sales Representative to get an idea of when
    certification might be coming.
    I hope this helps.
    - Ginny
    "Michael Schulz" <[email protected]> wrote in message
    news:[email protected]..
    I'm using WebLogic 6.0sp1 with Commerce Server 3.5 and I've successfully
    installed the demo. I would like to create another commerce server
    installation, this time using Microsoft SQL Server 2000 as the database
    instead of Cloudscape. I've downloaded and installed the BEA jDriver
    for MS SQL 7/2000 and tested it using dbping. My question is: where are
    the db scripts for creating and populating the commerce database? I've
    found the WLCS_320_DB_DDL_1.1.zip file on the BEA downloads site, but
    I'm concerned that this schema is for Version 3.20 of Commerce Server.
    Is there a similar file for WLCS 3.50? If not, is it safe to use this
    one?
    If this is posted in the wrong place, please let me know and I'll repost
    to the appropriate newsgroup as required.
    Sincerely,
    Michael Schulz

  • Using MS SQL Server 2000 for WLCS 3.50 DB

    I'm using WebLogic 6.0sp1 with Commerce Server 3.5 and I've successfully
    installed the demo. I would like to create another commerce server
    installation, this time using Microsoft SQL Server 2000 as the database
    instead of Cloudscape. I've downloaded and installed the BEA jDriver
    for MS SQL 7/2000 and tested it using dbping. My question is: where are
    the db scripts for creating and populating the commerce database? I've
    found the WLCS_320_DB_DDL_1.1.zip file on the BEA downloads site, but
    I'm concerned that this schema is for Version 3.20 of Commerce Server.
    Is there a similar file for WLCS 3.50? If not, is it safe to use this
    one?
    If this is posted in the wrong place, please let me know and I'll repost
    to the appropriate newsgroup as required.
    Sincerely,
    Michael Schulz

    Hi Michael,
    At this time SQL Server 2000 is not certified for WLCS 3.5. Since the
    schema has changed between 3.2 and 3.5, running the 3.2 scripts is not a
    good idea.
    I can tell you that certification is in progress for SQL Server 2000. Your
    best bet is to contact your Sales Representative to get an idea of when
    certification might be coming.
    I hope this helps.
    - Ginny
    "Michael Schulz" <[email protected]> wrote in message
    news:[email protected]..
    I'm using WebLogic 6.0sp1 with Commerce Server 3.5 and I've successfully
    installed the demo. I would like to create another commerce server
    installation, this time using Microsoft SQL Server 2000 as the database
    instead of Cloudscape. I've downloaded and installed the BEA jDriver
    for MS SQL 7/2000 and tested it using dbping. My question is: where are
    the db scripts for creating and populating the commerce database? I've
    found the WLCS_320_DB_DDL_1.1.zip file on the BEA downloads site, but
    I'm concerned that this schema is for Version 3.20 of Commerce Server.
    Is there a similar file for WLCS 3.50? If not, is it safe to use this
    one?
    If this is posted in the wrong place, please let me know and I'll repost
    to the appropriate newsgroup as required.
    Sincerely,
    Michael Schulz

  • Can't create an MBO object using an SQL Server connection profile

    Hi all,
    I'm trying to create an MBO from an table using an SQL Server connection profile. The connection is fine but when i grag a table into Mobile Application Diagram in order to create an MBO i got the following exeption:
    I´ve already configured the necessary jar (sqljdbc4.jar) in the following directories:
    C:\Sybase\UnwiredPlatform\Servers\UnwiredServer\lib
    C:\Sybase\UnwiredPlatform\Unwired_WorkSpace\Eclipse\sybase_workspace\mobile\eclipse\plugins\com.sybase.uep.com.sqlserver_2.1.0.201109131337
    but i always get the same error.
    Any help, suggest would be apreciated
    thx,
    Nuno

    Hi Nuno,
    I just wanted you to verify the path where you have pasted JAR file. As you mentioned
    Path 1:
    C:\Sybase\UnwiredPlatform\Servers\UnwiredServer\lib
    but as per doc it should be under:
    C:\Sybase\UnwiredPlatform\Servers\UnwiredServer\lib\3rdparty
    Path 2:
    C:\Sybase\UnwiredPlatform\Unwired_WorkSpace\Eclipse\sybase_workspace\mobile\eclipse\plugins\com.sybase.uep.com.sqlserver_2.1.0.201109131337
    but as per doc it should be under:
    C:\Sybase\UnwiredPlatform\Unwired_WorkSpace\Eclipse\sybase_workspace\mobile\eclipse\plugins\com.sybase.uep.com.sqlserver_2.1.0.201109131337\lib
    Rgrds,
    JK

  • SQL ENTERPRISE: The edition of Reporting Services that you are using requires that you use local SQL Server relational databases for report data sources and the report server database

    The error below makes absolutely no sense! I'm using Enterprise Core...yet I'm being told I can't use remote data sources:
    w3wp!library!8!03/05/2015-19:08:48:: i INFO: Catalog SQL Server Edition = EnterpriseCore
    w3wp!library!8!03/05/2015-19:08:48:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.OperationNotSupportedException: , Microsoft.ReportingServices.Diagnostics.Utilities.OperationNotSupportedException: The feature: "The edition of Reporting
    Services that you are using requires that you use local SQL Server relational databases for report data sources and the report server database." is not supported in this edition of Reporting Services.;
    Really? This totally contradicts the documentation found here:
    https://msdn.microsoft.com/en-us/library/ms157285(v=sql.110).aspx
    That article says remote connections are completely supported.
    ARGH! Why does this have to be so difficult to setup?!?

    Hi jeffoliver1000,
    According to your description, you are using Enterprise Core edition and you are prompted that you can’t use remote data sources.
    In your scenario, we neither ignore your point nor be doubt with what you say. But actually we have met the case before that even though the SQL Server engine is Enterprise but the reporting services is still standard. So I would recommend you to find the
    actual edition of reporting services you are using. You can find Reporting Services starting SKU in the Reporting Service logs ( default location: C:\Program Files\Microsoft SQL Server\<instance name>\Reporting Services\LogFiles). For more information,
    please refer to the similar thread below:
    https://social.technet.microsoft.com/Forums/en-US/f98c2f3e-1a30-4993-ab41-acbc5014f92e/data-driven-subscription-button-not-displayed?forum=sqlreportingservices
    By the way, have you installed the other SQL Server edition before?
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Using MS-SQL Server tables to build Universes

    My team has been tasked to create Universes so users can create WEBI reports.  We don't have a business warehouse, but that appeared not to be a problem as our understanding is that we can create Universes directly from MS-SQL Server tables. 
    On attempting to use Microsoft SQL Server Management Studio (20005), we find that once we expand the list of tables for SAP performance slows down to a 5 to 10 second response time between mouse clicks. 
    Is there a setting to work around this?  Are we approaching this the wrong way?  Is there documentation that addresses this?
    Thanks,
    Leo

    Hi Leo,
    There are a couple of options which can help improve the performance of your designer.
    1) Under tools, options on the graphics tab if you turn off the Show Row Counts, then the db will not be queried for the number of rows
    2) Check tools, options general ensure Automatic parse upon defintion and check universe integrity at opening are checked off
    It is not clear from your message, but you mentioned SAP as your source. I am not sure if you intended that you were connecting directly to SAP or not.
    The number of tables can also have an impact of the performance of the designer tool. You can limit the number of tabels by tailoring a tables strategies. This means you can limit the query that returns the list of table to a specific set.
    Hope this helps
    Alan

  • Does Exchange Server 2003 use M$SQL Server?

    Hi All,
    I have a new customer with SBS 2003 running as an Exchange Server.  He have four workstations and one server.  He is also running M$SQL Server 2005.  Does Exchange Server use M$SQL Server?  (Need to know for backup considerations.)
    Many thanks,-T

    No problem. Check if you have SQL management studio installed on the computer and open it up,to see what db are in there.
    Regards,
    Denis Cooper
    MCITP EA - MCT
    Help keep the forums tidy, if this has helped please mark it as an answer
    Blog: http://www.windows-support.co.uk 
    Twitter:   LinkedIn:

  • Can I use Microsoft SQL Server Management Studio version 11.0 to write SQL queries for "SQL Server Compact 4.0 Local Database"

    Hi, Can I use Microsoft SQL Server Management Studio version 11.0 to write SQL queries for "SQL Server Compact 4.0 Local Database" ?
    When I use Connect Object Explorer, the "Connect to Server" dialog box which pops up has only 4 selections in the Server Type Drop Down List. They are Database Engine, Analysis Services, Reporting Services & Integration Services. I have read
    somewhere that there should be a compact database option. but I do not see it.
    What I would like to do is use free form SQL Queries against the tables in "SQL Server Compact 4.0 Local Database" .
    Once I have validated these queries, then I will use them in my Visual Studio 2012 C#, ASP.NET application. I created the Local Database using Visual Studio 2012 for use by my application.
    Thank you for your help..
    diana4

    Hello,
    With SSMS 2005 we have had the Option to work with SQL CE database files, but not with higher Version of SSMS.
    You can use the free SQL CE Toolbax instead; see
    http://sqlcetoolbox.codeplex.com/
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

Maybe you are looking for

  • Refreshing drop down list in a web template based on a query view

    Refreshing drop down list in a web template based on a query view   I have just developed my first set of portal pages displaying the results of Bex queries and query views in the SAP Netweaver portal. I developed the pages using web application desi

  • Won't sync or update, only music with a lot of luck

    I just bought a new ipod 8 gb and I am working on windows xp. When I connect my ipod to Itunes it will sync, but then Itunes reject the ipod and it's impoissible to update postcasts, update/reset the ipod from Itunes or anything else. And I saw that

  • HT4623 tried to update my iphone 3, but after going to settings/ general there is no software update tab.

    I have the Weather network app. I did a update on this app. then the app stop working. I removed and installed a couple times. I have just tried to update from apple Iphone link. going to settings / general/ software updates. there was no tab (softwa

  • Not recognized raw files from Nikon D7000

    Hi, I have just bought a Nikon D7000 in stead of my D60. Now my Photoshop Element 9 cannot recognize the files/pictures, which I do not understand. Can anyone help me?

  • Help! Flash won't open!

    Help! I need to finsh a project ... I'm still suing Flash MX. Everything was fine until I reinstalled OS X 4.9. Now Flash Quits on startup. Am I missing a font or something? Here's the first part of the error log: Date/Time: 2007-03-27 10:55:15.836 -