rmaadil 0 Newbie Poster

In one of my application I am getting (through OTL using ODBC drivers) the following information from the SQL Server 2005 for each table

  • Column Name
  • Datatype of each column
  • Primary key information

and after getting this information I create a table with the same schema information in another database (through OTL using ODBC drievrs). As far as the schema and primary key constraint is concerned, these are same in both DBs (source and destination) but one information that I am unable to get from the source DB and consequently unable to create it in the destination DB is **filegroup ** information. I am pasting the scripts of both tables

//Source table script

CREATE TABLE [dbo].[test](
[Name] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Address] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CONSTRAINT [pkey_opinfo2] PRIMARY KEY CLUSTERED
(
[Name] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [Students]
) ON [Students]


//destination table script

CREATE TABLE [dbo].[test](
[Name] [varchar](20) COLLATE Latin1_General_CI_AI NULL,
[Address] [varchar](50) COLLATE Latin1_General_CI_AI NULL,

PRIMARY KEY CLUSTERED
(
[Code] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

I know that there are some minor differences in both scripts but I don't need to worry about that. The only thing I want is, that I want to get the [B]filegroup [/B]name (in this case Students) before creating the table in the destination DB. Can anyone tell me that how can I get the filegroup information.

Regards,
Rana M. Aadil Imdad

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.