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
193 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 36

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
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.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now