none
Can somebody post the sql-script database of course 10264A? RRS feed

Answers

  • Looking among the course setup files in my hard disk, I found the following script for creating the Blog and Bloggers tables. I don't recall how or where I got it, but it appears to do the job:

    CREATE TABLE [SalesLT].[Blogger](
    	[BloggerID] [int] IDENTITY(1,1) NOT NULL,
    	[Name] [nvarchar](50) NULL,
     CONSTRAINT [PK_Blogger] PRIMARY KEY CLUSTERED 
    (
    	[BloggerID] ASC
    ))
    GO
    CREATE TABLE [SalesLT].[Blog](
    	[BlogID] [int] IDENTITY(1,1) NOT NULL,
    	[BloggerID] [int] NULL,
    	[DatePosted] [datetime] NOT NULL,
    	[Title] [nvarchar](50) NOT NULL,
    	[BlogEntry] [nvarchar](max) NOT NULL,
     CONSTRAINT [PK_Blog] PRIMARY KEY CLUSTERED 
    (
    	[BlogID] ASC
    ))
    GO
    ALTER TABLE [SalesLT].[Blog] ADD  CONSTRAINT [DF_Blog_DatePosted]  DEFAULT (getdate()) FOR [DatePosted]
    GO
    ALTER TABLE [SalesLT].[Blog]  WITH CHECK ADD  CONSTRAINT [FK_Blog_Blogger] FOREIGN KEY([BloggerID])
    REFERENCES [SalesLT].[Blogger] ([BloggerID])
    GO
    ALTER TABLE [SalesLT].[Blog] CHECK CONSTRAINT [FK_Blog_Blogger]
    GO
    insert into [SalesLT].[Blogger] values ('Mary');
    GO
    insert into [SalesLT].[Blog] values (1, getdate(), 'My First Blog', 'Welcome to my Blog');
    GO

    • Marked as answer by pjdevries Sunday, May 5, 2013 5:02 PM
    Sunday, May 5, 2013 2:58 PM

All replies

  • I haven't taught 10264A since last year, but if I recall correctly it ran just fine from the AdventureWorksLT2008R2 database. It can be downloaded from this page:

    http://msftdbprodsamples.codeplex.com/releases/view/93587

    Sunday, May 5, 2013 9:23 AM
  • Hi Alberto,

    I've tried this database (AdventureWorksLT2008R2_Data.mdf), however, it's missing the Blog/Blogger-tables and possibly more?! Apparently, there should be a student CD included with the course that contains the SQL-script with these tables, however, they're not included with the material that can be downloaded, hence, the question, but if I'm missing something then please let me know!

    Greetings,

    Pieter

    • Marked as answer by pjdevries Sunday, May 5, 2013 5:02 PM
    • Unmarked as answer by pjdevries Sunday, May 5, 2013 5:02 PM
    Sunday, May 5, 2013 10:37 AM
  • Looking among the course setup files in my hard disk, I found the following script for creating the Blog and Bloggers tables. I don't recall how or where I got it, but it appears to do the job:

    CREATE TABLE [SalesLT].[Blogger](
    	[BloggerID] [int] IDENTITY(1,1) NOT NULL,
    	[Name] [nvarchar](50) NULL,
     CONSTRAINT [PK_Blogger] PRIMARY KEY CLUSTERED 
    (
    	[BloggerID] ASC
    ))
    GO
    CREATE TABLE [SalesLT].[Blog](
    	[BlogID] [int] IDENTITY(1,1) NOT NULL,
    	[BloggerID] [int] NULL,
    	[DatePosted] [datetime] NOT NULL,
    	[Title] [nvarchar](50) NOT NULL,
    	[BlogEntry] [nvarchar](max) NOT NULL,
     CONSTRAINT [PK_Blog] PRIMARY KEY CLUSTERED 
    (
    	[BlogID] ASC
    ))
    GO
    ALTER TABLE [SalesLT].[Blog] ADD  CONSTRAINT [DF_Blog_DatePosted]  DEFAULT (getdate()) FOR [DatePosted]
    GO
    ALTER TABLE [SalesLT].[Blog]  WITH CHECK ADD  CONSTRAINT [FK_Blog_Blogger] FOREIGN KEY([BloggerID])
    REFERENCES [SalesLT].[Blogger] ([BloggerID])
    GO
    ALTER TABLE [SalesLT].[Blog] CHECK CONSTRAINT [FK_Blog_Blogger]
    GO
    insert into [SalesLT].[Blogger] values ('Mary');
    GO
    insert into [SalesLT].[Blog] values (1, getdate(), 'My First Blog', 'Welcome to my Blog');
    GO

    • Marked as answer by pjdevries Sunday, May 5, 2013 5:02 PM
    Sunday, May 5, 2013 2:58 PM
  • Hi Alberto, 

    Working so far! Thanks!

    Sunday, May 5, 2013 5:02 PM