GENERAL SQL SERVER: Question about the Script that setups the SQL Server Database.

This is the first time I have created a script for Sql Server 2000, and I have run into a few syntax ereas that I am not familar with.  Bellow is a section of the script from the Portal server packages.  At the end of the sample, is "ON [PRIMARY], Can anyone explain to me what this does and why the primary key isnt setup inside the code itself?  I am basically trying to take parts of the script and incorrporate it into my own script and hate added syntax that I dont understand, makes debugging a real pain in the future.


CREATE TABLE [dbo].[Portal_Announcements] (
[ItemID] [int] IDENTITY (0, 1) NOT NULL ,
[ModuleID] [int] NOT NULL ,
[CreatedByUser] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[CreatedDate] [datetime] NULL ,
[Title] [nvarchar] (150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[MoreLink] [nvarchar] (150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[MobileMoreLink] [nvarchar] (150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ExpireDate] [datetime] NULL ,
[Description] [nvarchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO

Thanks
Daniel Demers
0
FaithNoMore
1/30/2004 7:36:00 PM
asp.net.portal-starter-kit 2189 articles. 0 followers. Follow

1 Replies
887 Views

Similar Articles

[PageSpeed] 37

CREATE TABLE [dbo].[Portal_Announcements] ( 

[ItemID] [int] IDENTITY (0, 1) NOT NULL ,
[ModuleID] [int] NOT NULL ,
[CreatedByUser] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[CreatedDate] [datetime] NULL ,
[Title] [nvarchar] (150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[MoreLink] [nvarchar] (150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[MobileMoreLink] [nvarchar] (150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[ExpireDate] [datetime] NULL ,
[Description] [nvarchar] (2000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO

The Value ON [PRIMARY] is referring to the current, AKA "Primary", database.
The line "[ItemID] [int] IDENTITY (0, 1) NOT NULL ," is the line that sets the
Primary Key. It is a statement that the column ItemID is an integer value type
and set to be an IDENTITY that starts at 0 and increments by 1 and cannot be null.
Primary Keys cannot be null, are most often numeric, and incremental so that as
a row is created in the table the value will be set by default.
Generally speaking you can omit the "COLLATE SQL_Latin1_General_CP1_CI_AS" because
the "local" settings of the computer can be read to determine the approiate collation.
the NULL at the end is stating that the field can contain NULL values.
Hope this helps. If your using SQL Server you may want to try the books online that
is included. I'm not sure if this is included with the MSDE version but it's worth
a shot and can answer most questions.
0
ohbajesus
2/10/2004 5:11:46 AM
Reply:

Similar Artilces:

Converting MDF files (SQL Server Express) to SQL Server 2005 WITHOUT having to buy SQL Server 2005 (I have Express). Personal WebSite Starter Kit
Hi (and HELP!),   I downloaded the Personal WebSite Starter Kit and got it working no problem on my local machine.  But I've had nothing but frustration trying to get it up and running on a webhosting site.  I picked hostmysite.com which uses SQL Server 2005.  I was under the impression that it wouldn't be that big a deal to convert the .MDF files that Sql Server Express uses to a SQL Server 2005 database.  I tried using SQL Server Management Studio Express.  I was able to "see" my remote database on hostmysite.com, but I was not able to import the .mdf files ...

Converting MDF files (SQL Server Express) to SQL Server 2005 WITHOUT having to buy SQL Server 2005 (I have Express). Personal WebSite Starter Kit
Hi (and HELP!),   I downloaded the Personal WebSite Starter Kit and got it working no problem on my local machine.  But I've had nothing but frustration trying to get it up and running on a webhosting site.  I picked hostmysite.com which uses SQL Server 2005.  I was under the impression that it wouldn't be that big a deal to convert the .MDF files that Sql Server Express uses to a SQL Server 2005 database.  I tried using SQL Server Management Studio Express.  I was able to "see" my remote database on hostmysite.com, but I was not able to import the .mdf file...

Converting MDF files (SQL Server Express) to SQL Server 2005 WITHOUT having to buy SQL Server 2005 (I have Express). Personal WebSite Starter Kit
Hi,Basically i built a webpage with Login and it's working well from my local machine.Right now, i'm using Database Publishing Wizard. the problem is how do i convert.MDF files to .SQL 2005 to get my database publish in the internet? thanks  Place your .MDF file in the App_Data directory, change the connection string accordingly and then publish your web site. ----------------------------------------------------------Please click Mark As Answer if this helped in solving your problem.  Please click "Mark As Answer" if this hepled in solving your problem. ...

Cannot restore database in the computer is setuped SQL Server 2000 and SQL server 2005
Hi All I have Computer is setuped SQL Server 2000 and SQL server 2005 when I restore SQL Server 2005 it's OK but when it's not OK when I restore in SQL Server 2000. The Error as follows: Please help me to solve this problem. Thanks   check this url, http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=169145&SiteID=1 http://sqlforums.windowsitpro.com/web/forum/messageview.aspx?catid=60&threadid=42121&enterthread=y...

moving an sql server 2005 database to a sql server 2000 database
I am trying to move a database which I wrote in SQL Server 2005 to a SQL Server 2000 database. I'm not sure the best way to do this....... Can anyone enlighten me?.....   this article explains it. http://searchsqlserver.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid87_gci1149585_tax301536,00.html hth,mcm pizzamaker74: I am trying to move a database which I wrote in SQL Server 2005 to a SQL Server 2000 database. I'm not sure the best way to do this....... Can anyone enlighten me?..... If both are in the same network or box just register the 2005 with the 2000 cr...

SQL Server Database File vs SQL Server Database -VWD Express
VWD Express 2008, SQL Server Express 2005. I have been using SQL Server Express with ASP and VB for some years - I just create a DB in Management Studio Express, have SQL Server set to 'SQL Server and Windows authentication', and use a connection string with 'sa' and a password (I never have managed to get it working with 'integrated security', but that is probably irrelevant to this post). So I have a list of DB's attached to SQL Server that I can see, attach, detach etc in MSE. I am getting started with .NET. Working through a VWD Express book tutori...

Migrating sql server 2005 express database to sql server 2005 database
Hi, I have an application developed using VWD and sqlserver express database. The express database is turning out to be small in size and we need to migrate to larger sqlserver 2005 database. What are the steps for this migration, please list in detail. Regards, Sandyhttp://www.thequinn.infohttp://www.sksdataservices.comhttp://www.infobasket.info Hi Sandy, To move a database from SQL Express to SQL 2005, you can use the following steps. 1. If your database file is attached to the server instance, you will need to detach it first using SQL management studio. If it is under App_Data folde...

SQL Server 2000 and SQL Server 2005 in the same server
Can enyone please send me a link to a white paper explaining how to run both SQL Server 2000 and 2005 in the same machine?Thanks. I don't know about the white paper but I had both running on my machine for a while by making the SQL 2000 a named instance. So for SQL 2005 connection strings my server name was (local) while for SQL 200 using the named instance it was (local)\joesql where joesql was the instance nameHope it helps,Joe http://www.joeaudette.comhttp://www.mojoportal.com...

Newbie with question about SQL Server and SQL Server Lite
Hi Folks.. Hey, I've got a small app I've got to write that uses currently an Access Database.. The frontend is what I'm working on as the client designed the DB for his client, and I'm desiginging the web site for his client that connects to that DB.. THe hosting company that I use gives me SQL server just for the job, and where the end product is going to be hosted doesn't have SQL server, so I'm wondering if it's ok to use SQL server lite, the newest version for such a thing since it's free, and what restrictions there are? I mean: Is it ok to use for commercial apps? How many connect...

This version of Microsoft Sql Server Management Studio can only be used to connect to Sql Server 2000 and Sql Server 2005 servers
When I connect SQL Server 2005 to a remote database i get the error: "This version of Microsoft Sql Server Management Studio can only be used to connect to Sql Server 2000 and Sql Server 2005 servers". Can I confirm it is because: the remote db is of SQL Server 2008? There is a soln mentioned in http://forums.asp.net/t/1324047.aspx Did anybody try this (installing 2008 express: http://www.microsoft.com/express/sql/download/)? I am just checking again, whether it will disturb my existing SQL Server installation, in any means...? Though it is mentioned that it will g...

SQL Server 2005 Installation problems with SQL Server Express & SQL Server 2000
Hi Guys, I have had SQL Server Express and Sql Server Management Studio Express installed on my machine for some time and recently tried to install a trial of SQL Server 2005 as well.  (Yes, I'm migrating from Visual Studio Express to Visual Studio Professional, just as in tended!) Everything went fine except that nothing seemed to be installed.  I searched in all the obvious places - both on the Start/Programs menu and on the hard-drive: nothing. A check under Add/Remove Programs showed that Sql Server 2005 Express was installed, but called SQL Server 2005. So after a number o...

Can microsoft SQL Server 2005 database upgrade to microsoft SQL Server 2008 database?
I have a microsoft SQL Server 2005 database, I don't know how to upgrade the 2005 database to 2008 database, I try to use SQL Server Management Studio Express 2008 to open the 2005 database, it's OK, does it mean that the 2005 database have been upgraded to 2008 database? BTW, is SQL Server 2005 database compatible with SQL Server 2008 database completely?SuperCool Multiple ZIP - A utility to unzip multiple files and work with multiple zip filesSuperCool Random Number Generator Yes. It is compatible. Anyhow go through this url for more informationhttp://msdn.microsoft.com/en-us/li...

How to convert a SQL Server 2005 Database to SQL Server Express
Hi, I have a SQL Server 2005 Database that I would like to export to SQL Server Express. How do I go about this? I've tried backing it up, creating a new (blank) SQL Server Express Database and trying to restore it, but get the following message: TITLE: Microsoft SQL Server Management Studio------------------------------ Restore failed for Server 'PRODSOL-LAPTOP1\SQLEXPRESS'.  (Microsoft.SqlServer.Smo) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOp...

Restoring a SQL Server 2005 database into SQL Server 2000
Hey guys  We currenlty have SQL Server 2000 installed inhouse for testing.  A client has given us a backup of their 2005 database and i'm wondering if the restore will work into 2000, or any issues i should be aware of. Should i just install msde locally on my machine and restore the database?  thanks Hi,Ask your client to backup database as 2000 format. There is an option for this in Microsoft SQL Server Managment Studio. Then download MSSMSE and install for yourself and try to restore database from it.If database doesn't use any 2005 features (rowcount for exampl...

Web resources about - GENERAL SQL SERVER: Question about the Script that setups the SQL Server Database. - asp.net.portal-starter-kit

German question - Wikipedia, the free encyclopedia
"Kleindeutschland" redirects here. For the neighborhood in New York City, see Little Germany, Manhattan . 1820 map of Central Europe showing ...

Police question Nagambie GP over "lethal dose" to help patient die
Nagambie doctor Alan Kosky did not want to his elderly patients to suffer. But police, the coroner and now federal health officials are probing ...

The Islamic State inspires Eric Posner to question American values
Slate got a lot of hateclicks yesterday for publishing Eric Posner’s argument that, in light of the Islamic State’s efforts to radicalize American ...

Submit your questions for Autoblog Podcast #459
Filed under: Podcasts On Episode #459 of the Autoblog Podcast, we'll discuss Cadillac's Escalade problem, GMC's need for a CUV, diesel and hybrid ...

Excellent Question from an Awful Candidate
Cholly Pierce notes that tribble-topped presidential aspirant Rand Paul actually asked an important question during last night’s GOP debate shit-show: ...

Quick Question
(Don Boudreaux) Tweet If advocates of stricter gun-control regulations are correct that easy access to hand guns necessarily leads to more ...

Chris Matthews Really Doesn’t Like Questions About His Leg
Politics can be so exhausting. Sometimes you just need to have a little fun. And all of us, no matter where we fall on the sociopolitical spectrum, ...

The question remains: Would Bush support a 'Trump for president' ticket?
Donald Trump vowed to forego a third-party run and stick with the GOP during last night’s debate, but we still don't know whether the other candidates ...

Tom Brady Leaves Press Conference After Two Questions About His Friendship With Donald Trump
This morning’s cover of the New York Daily New s features the headline “BRADY HAS NO BALLS” over a picture of New England Patriots quarterback ...

'Star Wars: The Force Awakens' Cast Fields Your Fan Questions
ET got the cast to answer a few of your fan questions at the premiere.

Resources last updated: 12/17/2015 9:43:56 PM