Skip to content

Haygrays

Some random tech stuff!

  • Home
  • SQL Server
  • Oracle
  • Linux
    • RHCSA : Free Revision Notes
    • RHCE : Free Revision Notes
    • Oracle on Linux

Tag: create synonym

SQL Server : CREATE SYNONYM

Make sure you are using the correct database;

USE MyDatabase;
GO

Create a synonym as an alternate name for an existing object.

CREATE SYNONYM employees2 FOR MyDatabase.dbo.employees;

Reference the synonym in a query.

SELECT * FROM employees2;

Drop the synonym.

DROP SYNONYM employees2;

For more information see:

  • CREATE SYNONYM (Transact-SQL)
  • DROP SYNONYM (Transact-SQL)

About

Just another collection of bits and pieces that might come in useful.

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
  • Home
  • SQL Server
  • Oracle
  • Linux
    • RHCSA : Free Revision Notes
    • RHCE : Free Revision Notes
    • Oracle on Linux
Haygrays Privacy Policy Proudly powered by WordPress