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.
| Author |
Topic |
|
viperbyte
Posting Yak Master
132 Posts |
Posted - 2010-04-01 : 14:10:46
|
| Hi everyone. I've taken on a vb project where I've been given a script that creates a number of tables. All the tables’ creations end with a "ON PRIMARY". There's no mention of PRIMARY KEY in the script on any of the create table part of the script. What does "ON PRIMARY" do in the script if a column isn't specified as the key? I have include one create table snippet in this message for example.USE [develop]GO/****** Object: Table [develop_develop].[CMRC_Articles] Script Date: 02/22/2010 11:29:33 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOSET ANSI_PADDING ONGOIF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[develop_develop].[CMRC_Articles]') AND type in (N'U'))BEGINCREATE TABLE [develop_develop].[CMRC_Articles]( [ArticleID] [int] NOT NULL, [Title] [nvarchar](50) NOT NULL, [Description] [nvarchar](255) NOT NULL, [Link] [nvarchar](250) NULL, [Category] [nvarchar](20) NOT NULL, [ArticleData] [varbinary](max) NOT NULL, [DocType] [nvarchar](4) NOT NULL, [ArticleDate] [datetime] NULL, [Hide] [bit] NOT NULL) ON [PRIMARY]END |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-01 : 14:12:58
|
| ON PRIMARY refers to creation of table in primary filegroup------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
viperbyte
Posting Yak Master
132 Posts |
Posted - 2010-04-01 : 17:06:29
|
| Thanks. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
viperbyte
Posting Yak Master
132 Posts |
Posted - 2010-04-01 : 18:21:32
|
| What if i don't do anything at all in referance to a filegroup? I mean what if I don't explicitly code the size of it or where it resides or anything at all. Would it be ok to just leave it in the script? It's in the script so I imagine it's in there for a reason. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|