?
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
Medium Priority
?
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Accepted Solution

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

ALTER SESSION SET CURRENT_SCHEMA = haggis
0
 
LVL 38

Expert Comment

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

Assisted Solution

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

just leave the schema name out.
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

770 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