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
195 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Parse field in SQL View 15 99
SQL Server stored proc 2 13
t-sql split string into multiple rows 7 41
How do I Start SQL Management Studio 2012 17 21
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

862 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

23 Experts available now in Live!

Get 1:1 Help Now