MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 23rd, 2004, 03:25 AM
rishijd rishijd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 299 rishijd User rank is Lance Corporal (50 - 100 Reputation Level)rishijd User rank is Lance Corporal (50 - 100 Reputation Level)rishijd User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 2 Days 11 h 50 m 8 sec
Reputation Power: 5
simple question: ON PRIMARY?

Hi,

Im really new to MS SQL - actually I just have a schema that I need to convert to Postgresql format. The MS SQL database already exists - I need to use a Postgresql web database to hold part of the master database's information.

So, I've converted most of the "CREATE TABLE" schema, but right at the end it says:

Code:
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO


I have NO idea what the ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] bit means. Can someone please explain to me? And what part this would play in my Postgresql conversion?

Ive been reading up a lot and find that the ON [PRIMARY] bit is pretty much standard with all tables, and TEXTIMAGE_ON [PRIMARY] is used a lot as well. But I'd just like to find out the meaning.

So far I'm presuming I'd just have to delete that line since it doesn't apply to Postgresql. Am I right?

Also, there was no primary key in the schema.. how does MS SQL identify the primary key for a table? I thought that every table needs at least one primary key ?

Thanks a lot in advance!

Reply With Quote
  #2  
Old July 23rd, 2004, 08:57 AM
pabloj's Avatar
pabloj pabloj is online now
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,824 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 1 Day 8 h 56 m 45 sec
Reputation Power: 278
You should Google a bit ... see http://doc.ddart.net/mssql/sql2000/...reate2_8g9x.htm as an example.
Quote:
ON {filegroup | DEFAULT}

Specifies the filegroup on which the table is stored. If filegroup is specified, the table is stored in the named filegroup. The filegroup must exist within the database. If DEFAULT is specified, or if ON is not specified at all, the table is stored on the default filegroup.

ON {filegroup | DEFAULT} can also be specified in a PRIMARY KEY or UNIQUE constraint. These constraints create indexes. If filegroup is specified, the index is stored in the named filegroup. If DEFAULT is specified, the index is stored in the default filegroup. If no filegroup is specified in a constraint, the index is stored on the same filegroup as the table. If the PRIMARY KEY or UNIQUE constraint creates a clustered index, the data pages for the table are stored in the same filegroup as the index.



Note DEFAULT, in the context of ON {filegroup | DEFAULT} and TEXTIMAGE_ON {filegroup | DEFAULT}, is not a keyword. DEFAULT is an identifier for the default filegroup and must be delimited, as in ON "DEFAULT" or ON [DEFAULT] and TEXTIMAGE_ON "DEFAULT" or TEXTIMAGE_ON [DEFAULT].


TEXTIMAGE_ON

Are keywords indicating that the text, ntext, and image columns are stored on the specified filegroup. TEXTIMAGE ON is not allowed if there are no text, ntext, or image columns in the table. If TEXTIMAGE_ON is not specified, the text, ntext, and image columns are stored in the same filegroup as the table.



Those are storage options, because you can store table data, indexes and blob content on different filegroups (and disks) to speed things up.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > simple question: ON PRIMARY?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway