For creating the DotNetTwitter Database on your local SQL Server.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Following]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Following]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Keywords]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Keywords]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Link]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Link]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Tweets]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Tweets]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Users]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Users]
GO
CREATE TABLE [dbo].[Following] (
[FollowingID] [uniqueidentifier] NOT NULL ,
[UserID] [uniqueidentifier] NULL ,
[FollowingUserID] [uniqueidentifier] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Keywords] (
[KeywordID] [uniqueidentifier] NOT NULL ,
[Keyword] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Link] (
[LinkID] [uniqueidentifier] NOT NULL ,
[KeywordID] [uniqueidentifier] NULL ,
[TweetID] [uniqueidentifier] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Tweets] (
[TweetID] [uniqueidentifier] NOT NULL ,
[Tweet] [char] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[DateStamp] [datetime] NULL ,
[UserID] [uniqueidentifier] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Users] (
[UserID] [uniqueidentifier] NOT NULL ,
[UserName] [char] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[UserImage] [char] (110) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment