Syntax is: [ServerName].[DatabaseName].[Owner].[TableName].[FieldName] So in your Stored Proc your request might look like: SELECT myField FROM myServer.myDatabase.dbo.myTable WHERE myField = 'some value' ServerName can be an ip address, or if it is on the same server - just a different database - you can omit ServerName altogether. Owner is usually 'dbo' -- otherwise substitute the table's owner
standers
Posts
-
Accessing a table in a different DB then the stored procedure -
SQL Server generate static HTML on a scheduleI have a problem that I wonder if you all can help me with. I have a table that could be updated every second, or every ten minutes (or more). I need to get the data from that table to provide real-time representation on a web page. To minimize the round trip to and from the db on the network, I had suggested that we retrieve data from the table and hold onto it in the Application Cache which refreshes itself every x seconds so that if many users are trying to view the data, they all pull from the Application Cache, not from SQL Server. However, it has also been suggested to me (by my supervisor) that we code a Trigger or a Job in SQL Server to generate a static HTML page (either on a schedule, or every time one of the fields in the table is updated) so that all requests for the page get handled by IIS and don't require a trip to the db. I can't imagine that this is a good programming practice... and I don't expect for more than about 50 users at a time (probably more like 10-20). Can anyone provide me with good arguments for either method? Thanks