Solved

SQL Server 2005 - How do I bypass the Schema name before the table name in any SQL statement?

Posted on 2009-07-11
3
199 Views
Last Modified: 2012-05-07
Hi,

I have created a database with a schema, I have a huge script that I have to execute against that database, but the problem is that the script does not use the schema name before the table (i.e. [Schema].[Table]) and I don't want to manually do that for all these commands!

Any idea?
0
Comment
Question by:feesu
3 Comments
 
LVL 14

Accepted Solution

by:
shru_0409 earned 300 total points
ID: 24829891
before run the script set schema name than run the script

ALTER SESSION SET CURRENT_SCHEMA = haggis
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 24830112
or
use schema
0
 
LVL 60

Assisted Solution

by:chapmandew
chapmandew earned 200 total points
ID: 24830372
select * from databasename..tablename

just leave the schema name out.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question