need a little help

Topics: General
Apr 9, 2012 at 8:32 AM

Hello every body

I face a little problem I have a system programmed with ASP

I want to uploaded it to my domain and I don’t know how

I think there is a problem with the unpack script which is the name of it is smsdatabase

Kindly can anyone help on this I only want to make the script work to make the system be ready to upload it to my domain

 

Here is the read me file I should use it to exctract the system

1- extract the .rar file in your virual directory for the application

2- open sqlserver2005 managment studio and run the script included in the "smsdatabase.txt" file

3-login creadentails is in the web.config file

note : please donot change the login name "smslogin" as it owns a function schema

but you can change its password

5- be sure that the Roles table contains data  and users table contains data

6- login by username : admin and password " admin

 

And here the script of smsdatabase.txt “ not working ??!!“

 

/****** Object:  Database [SMS]    Script Date: 01/10/2010 10:14:49 ******/

CREATE DATABASE [SMS] ON  PRIMARY

( NAME = N'SMS', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\SMS.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )

 LOG ON

( NAME = N'SMS_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\SMS_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)

GO

EXEC dbo.sp_dbcmptlevel @dbname=N'SMS', @new_cmptlevel=90

GO

IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))

begin

EXEC [SMS].[dbo].[sp_fulltext_database] @action = 'enable'

end

GO

ALTER DATABASE [SMS] SET ANSI_NULL_DEFAULT OFF

GO

ALTER DATABASE [SMS] SET ANSI_NULLS OFF

GO

ALTER DATABASE [SMS] SET ANSI_PADDING OFF

GO

ALTER DATABASE [SMS] SET ANSI_WARNINGS OFF

GO

ALTER DATABASE [SMS] SET ARITHABORT OFF

GO

ALTER DATABASE [SMS] SET AUTO_CLOSE OFF

GO

ALTER DATABASE [SMS] SET AUTO_CREATE_STATISTICS ON

GO

ALTER DATABASE [SMS] SET AUTO_SHRINK OFF

GO

ALTER DATABASE [SMS] SET AUTO_UPDATE_STATISTICS ON

GO

ALTER DATABASE [SMS] SET CURSOR_CLOSE_ON_COMMIT OFF

GO

ALTER DATABASE [SMS] SET CURSOR_DEFAULT  GLOBAL

GO

ALTER DATABASE [SMS] SET CONCAT_NULL_YIELDS_NULL OFF

GO

ALTER DATABASE [SMS] SET NUMERIC_ROUNDABORT OFF

GO

ALTER DATABASE [SMS] SET QUOTED_IDENTIFIER OFF

GO

ALTER DATABASE [SMS] SET RECURSIVE_TRIGGERS OFF

GO

ALTER DATABASE [SMS] SET  ENABLE_BROKER

GO

ALTER DATABASE [SMS] SET AUTO_UPDATE_STATISTICS_ASYNC OFF

GO

ALTER DATABASE [SMS] SET DATE_CORRELATION_OPTIMIZATION OFF

GO

ALTER DATABASE [SMS] SET TRUSTWORTHY OFF

GO

ALTER DATABASE [SMS] SET ALLOW_SNAPSHOT_ISOLATION OFF

GO

ALTER DATABASE [SMS] SET PARAMETERIZATION SIMPLE

GO

ALTER DATABASE [SMS] SET  READ_WRITE

GO

ALTER DATABASE [SMS] SET RECOVERY SIMPLE

GO

ALTER DATABASE [SMS] SET  MULTI_USER

GO

ALTER DATABASE [SMS] SET PAGE_VERIFY CHECKSUM

GO

ALTER DATABASE [SMS] SET DB_CHAINING OFF

GO

USE [SMS]

GO

/****** Object:  User [smslogin]    Script Date: 01/10/2010 10:14:49 ******/

CREATE USER [smslogin] FOR LOGIN [smslogin] WITH DEFAULT_SCHEMA=[dbo]

GO

/****** Object:  Table [dbo].[Roles]    Script Date: 01/10/2010 10:14:49 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[Roles](

                [RoleID] [int] IDENTITY(1,1) NOT NULL,

                [Role] [nvarchar](50) NULL,

 CONSTRAINT [PK_Roles] PRIMARY KEY CLUSTERED

(

                [RoleID] ASC

)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

) ON [PRIMARY]

GO

insert into Roles values ('Admins')

Go

insert into Roles values ('Users')

/****** Object:  Table [dbo].[test]    Script Date: 01/10/2010 10:14:49 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[test](

                [id] [int] IDENTITY(1,1) NOT NULL,

                [test] [int] NULL,

 CONSTRAINT [PK_test] PRIMARY KEY CLUSTERED

(

                [id] ASC

)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

) ON [PRIMARY]

GO

/****** Object:  UserDefinedFunction [dbo].[trueperc]    Script Date: 01/10/2010 10:14:49 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

create FUNCTION [dbo].[trueperc] (@postid int)

RETURNS decimal(18,3)

AS

-- Returns the stock level for the product.

BEGIN

    DECLARE @ret decimal(18,3)

 

declare @answ decimal(18,3)

declare @allusers int

select @answ =  count(*) from answers

where (postid = @postid) and (Answer = 1)

 

select @allusers =  count(*) from answers where (postid = @postid)

--select @ret = (@answ/@allusers)*100

 select @ret = ISNULL(@answ/NULLIF(@allusers,0),0)

set @ret = @ret *100

return @ret

 

END

GO

/****** Object:  Table [dbo].[Posts]    Script Date: 01/10/2010 10:14:49 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[Posts](

                [PostID] [int] IDENTITY(1,1) NOT NULL,

                [Post] [nvarchar](1000) NULL,

                [Post_Date] [datetime] NULL,

                [Expiration_Date] [datetime] NULL,

                [UserID] [int] NULL,

                [Correct_Answ] [bit] NULL CONSTRAINT [DF_Posts_Correct_Answ]  DEFAULT ((0)),

 CONSTRAINT [PK_Posts_1] PRIMARY KEY CLUSTERED

(

                [PostID] ASC

)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

) ON [PRIMARY]

GO

/****** Object:  Table [dbo].[Answers]    Script Date: 01/10/2010 10:14:49 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[Answers](

                [Answ_ID] [int] IDENTITY(1,1) NOT NULL,

                [Answer] [bit] NULL CONSTRAINT [DF_Answers_Answer]  DEFAULT ((0)),

                [PostID] [int] NULL,

                [UserID] [int] NULL,

 CONSTRAINT [PK_Answers_1] PRIMARY KEY CLUSTERED

(

                [Answ_ID] ASC

)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

) ON [PRIMARY]

GO

/****** Object:  Table [dbo].[Extra_Admins]    Script Date: 01/10/2010 10:14:49 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[Extra_Admins](

                [Id] [int] IDENTITY(1,1) NOT NULL,

                [admin_Email] [nvarchar](200) NULL,

                [admin_Tel] [nvarchar](50) NULL,

 CONSTRAINT [PK_Extra_Admins] PRIMARY KEY CLUSTERED

(

                [Id] ASC

)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

) ON [PRIMARY]

GO

CREATE TABLE [dbo].[gateway_setting](

                [ID] [int] IDENTITY(1,1) NOT NULL,

                [username] [nvarchar](50) NULL,

                [userpassword] [nvarchar](50) NULL,

                [api_id] [nvarchar](100) NULL,

                [baseurl] [nvarchar](200) NULL,

PRIMARY KEY CLUSTERED

(

                [ID] ASC

)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

) ON [PRIMARY]

Go

 

/****** Object:  UserDefinedFunction [dbo].[getfromdate]    Script Date: 01/10/2010 10:14:49 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

create function [dbo].[getfromdate](@mon nvarchar(50) , @yea nvarchar(50))

RETURNS datetime

as

begin

declare @fromdate datetime

set @fromdate = @yea + '-' + @mon +'-01'

 

 

return @fromdate

end

GO

/****** Object:  UserDefinedFunction [dbo].[gettodate]    Script Date: 01/10/2010 10:14:49 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

create function [dbo].[gettodate](@mon nvarchar(50) , @yea nvarchar(50))

RETURNS datetime

as

begin

declare @todate datetime,@tempdate datetime

set @tempdate = @yea + '-' + @mon +'-01'

 

SELECT @todate = DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,@tempdate)+1,0))

 

return @todate

end

GO

/****** Object:  Table [dbo].[Users]    Script Date: 01/10/2010 10:14:49 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE TABLE [dbo].[Users](

                [UserID] [int] IDENTITY(1,1) NOT NULL,

                [Name] [nvarchar](250) NULL,

                [Email] [nvarchar](250) NULL,

                [Tel] [nvarchar](50) NULL,

                [Job_Title] [nvarchar](100) NULL,

                [Address] [nvarchar](500) NULL,

                [Username] [nvarchar](50) NULL,

                [UserPassword] [nvarchar](50) NULL,

                [Active] [bit] NULL,

                [RoleID] [int] NULL,

 CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED

(

                [UserID] ASC

)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

) ON [PRIMARY]

GO

insert into Users values('administrator','esbtan@yahoo.com','01234569874','developer','23 hassan street','admin','admin',1,1)

Go

/****** Object:  UserDefinedFunction [dbo].[perc]    Script Date: 01/10/2010 10:14:49 ******/

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE FUNCTION [dbo].[perc] (@postid int)

RETURNS decimal(18,3)

AS

-- Returns the stock level for the product.

BEGIN

    DECLARE @ret decimal(18,3)

 

declare @answ decimal(18,3)

declare @allusers int

select @answ =  count(*) from answers

where postid = @postid

select @allusers = count(*) from users where Active = 1

--select @ret = (@answ/@allusers)*100

 select @ret = ISNULL(@answ/NULLIF(@allusers,0),0)

set @ret = @ret *100

return @ret

 

END

GO

create function [smslogin].[getfromdate](@mon nvarchar(50) , @yea nvarchar(50))

RETURNS datetime

as

begin

declare @fromdate datetime

set @fromdate = @yea + '-' + @mon +'-01'

 

 

return @fromdate

end

Go

 

create function [smslogin].[gettodate](@mon nvarchar(50) , @yea nvarchar(50))

RETURNS datetime

as

begin

declare @todate datetime,@tempdate datetime

set @tempdate = @yea + '-' + @mon +'-01'

 

SELECT @todate = DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,@tempdate)+1,0))

 

return @todate

end

Apr 9, 2012 at 6:08 PM

Hi Marooo,

Sorry about the problems you are experiencing. However, it looks like your issue is related to SQL and not MVC or WebPages sources. I'm affraid we won't be able to help you here but you should definetely try one of the forums here: http://forums.asp.net/default.aspx/16?Data+Access where there are more SQL experts who might be able to help you.