Categories
SQL Server

Comparing Views and Synonyms in SQL Server

Last time out we looked at referencing tables across databases. While we of course have the option of using three-part naming to address the table, we also considered views and synonyms as two alternative options. Both of these can be used to achieve similar results. There are elements which they have in common and others which […]

Categories
SQL Server

Referencing Cross-Database Objects

In SQL Server we’ll typically end up using environments containing multiple databases which happen to have data which relate to each other. Due to this there will be times when we’ll need to reference objects in another database when writing a query. What options do we have for doing this? Here we’ll look at three […]

Categories
T-SQL Tuesday

T-SQL Tuesday #155 – The Dynamic Code Invitation

This months’ invitation from Steve Jones asks us to write about producing SQL dynamically in some form or another. We can create and execute SQL dynamically within our procedures but what about dynamically creating it from other sources before passing it into SQL Server? The quick I have to admit that Steve’s mention of using Excel […]

Categories
SQL

Changing Object Schema in SQL Server

We’ve previously looked at the basics of using schemas in SQL Server where we created a schema and used objects inside of it. If you’re not dealing with new objects though and wanted to move something into or out of a schema how to we go about that? Not by renaming it For renaming most objects within […]