Solved

Select into allways 'on default'?

Posted on 1998-09-30
4
405 Views
Last Modified: 2008-02-26
Hi again,

Can I tell sybase where to put my table using select into which creates that table?
0
Comment
Question by:lizzzard
  • 2
4 Comments
 

Expert Comment

by:kevincristo
ID: 1098329

Hi lizzzard,

First u have to set the sp_dboption "select into" true in that database

sp_dboption dbname,"select into",true (syntax)
go

After that u have to run check point in that database

use user1
go

checkpoint
go


Now you can run the following query

Select * into database.dbo.tablename from tablename
go

Example

use user1(database name)
go

Select * into user2.dbo.employee from employee
go

I hope it will help you.

Thanx


0
 

Author Comment

by:lizzzard
ID: 1098330
Hi, I think you misunderstood my question. I know how to do a select into, but the problem is that the table always shows up on the default segment. Unless I make a clustered index,ofcourse because that would move the whole table to the segment I define the index on.
The problem here is, that the select into is in a temporary table. I don't want to make an index on it and for some other reasons I don't want it on 'default'.

Regards, Alex
0
 
LVL 10

Accepted Solution

by:
bret earned 50 total points
ID: 1098331
The SELECT INTO syntax does not allow you to specify a segment, it always creates the table on default.

As you know, you can create (and then drop, if desired) a clustered index on the table to move it to a specified segment.

You can also use the sp_placeobject stored procedure to cause future allocations to be placed on a named segment, but the existing data will remain on default.

A possible work around is to
1) create the table using select into  where 1=0,
then
2) sp_placeobject on the desired segment,
then populate the table with
3) insert table select * from....
This approach does cause more log activity.
0
 

Author Comment

by:lizzzard
ID: 1098332
Hi,Bret

The method I use now is indeed the select into on default and the creating the clustered index on the desired segment,thus moving the table. The sp_placeobject might be something to look at.
Thanks
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cannot view sybase SCC in browser using Linux 5 1,814
To form a query 10 399
SyBase SQL DataTime Format 6 295
SyBase SQL Query Syntax 11 469
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Each year, investment in cloud platforms grows more than 20% (https://www.immun.io/hubfs/Immunio_2016/Content/Marketing/Cloud-Security-Report-2016.pdf?submissionGuid=a8d80a00-6fee-4b85-81db-a4e28f681762) as an increasing number of companies begin to…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

778 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