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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

713 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