title: Will the stored procedure be written to the database?
body: <p>I'm pretty new to SQL and I want to make sure I am not changing or editing anything on sql01 database.  I am allowed to read this database but not make any changes or edit anything.</p>
  
  <p>The second database called called app02 is created and owned by me.  So I can do whatever with it.</p>
  
  <p>Both databases are on different servers. </p>
  
  <p>I am doing a query to see which FIRSTNAME and LASTNAME are listed in both databases.  When I run the below, I will be connected to my database app02 in SQL Server.  I am having to run a stored procedure to connect to the database not owned by me:</p>
  
  <pre><code>EXEC sp_addlinkedserver @server='sql01'
  EXEC sp_addlinkedsrvlogin 'sql01', 'false', NULL, 'username', 'password's
  </code></pre>
  
  <p>Will this save to or edit anything on the sql01 database?
  Here is my complete query:</p>
  
  <pre><code>EXEC sp_addlinkedserver @server='sql01'
  EXEC sp_addlinkedsrvlogin 'sql01', 'false', NULL, 'username', 'password'
  
  SELECT LASTNAME, FIRSTNAME, STATUS, CLASS
    FROM sql01.database1.dbo.MyTable1 T1
    WHERE EXISTS (SELECT FIRSTNAME, LASTNAME 
                  FROM app02.database2.dbo.MyTable2 T2
                  WHERE T1.FIRSTNAME = T2.FIRSTNAME
                  AND T1.LASTNAME = T2.LASTNAME)
  </code></pre>