Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Specifying File Group in SELECT INTO

Author  Topic 

hnomani
Starting Member

35 Posts

Posted - 2006-07-19 : 15:24:38
Is it possible to specify the file group name in a SELECT INTO statement? I am trying to create a table using a SELECT INTO statement and would like to create this new table on a specified file group not the default one. Does anyone know the syntax?

Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-07-19 : 15:32:59
You can't use SELECT INTO for this but you can create the table first on the specified filegroup, then insert the data to this new table from your other table. This has the same effect as select into, just a little more typing for you.

Tara Kizer
Go to Top of Page

hnomani
Starting Member

35 Posts

Posted - 2006-07-19 : 15:39:38
Thanks, I am trying to load a large table around 5 GB in size from another server and the DTS is taking around 30 minutes. I am experimenting using SELECT INTO with Linked server to see if it loads faster (Drop & Recreate). Using INSERT SELECT will cause the data to be logged into transaction log and may slow the process. Any thoughts?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-07-19 : 15:45:08
SELECT INTO will also be logged. BULK INSERT is the fastest way to move data.

Tara Kizer
Go to Top of Page

hnomani
Starting Member

35 Posts

Posted - 2006-07-19 : 16:00:08
Both my source and destination servers are SQL Server 2000. BULK INSERT will only work when copying data from a file.

Thanks
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-07-19 : 16:03:01
Yes I realize that. You first would bcp out the data to a file, then BULK INSERT the data from the file. You are looking for a fast solution, right? You should at least test the performance of it.

Tara Kizer
Go to Top of Page
   

- Advertisement -