Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Database servers scripting
Message
 
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00810825
Message ID:
00810849
Views:
9
>>Hi everybody,
>>
>>Do you know, what does it mean Database servers scripting? I am running out of time (need to answer 20 questions till tomorrow). The question states:
>>In the WEB development environment define the term scripting. Give examples and explain how scripting is used in both web servers and database servers.
>>=======================
>>
>>For web servers I assume, I need to talk about server-side scripting, but what exactly is database servers scripting? I am not sure.
>
>The question is not well formulated, IMHO. If you talk about Web development you have both client and server side scripting.
>
>Database scripting is another issue and not necesarily related to Web development (although it is usual that both collaborate). Basically, database server scripting is the way to programatically manipulate data and database objects (tables structures, triggers, stored procedures, views, UDFs, etc).
>
>You write scripts (or in the case of SQL server, you can make the Enterprise Manager to generate them for you) to alter or create those objects, or to process data.
>
>I think the question is quite misleading.
>
>Hope this helps,

Hi Martin,

Thanks a lot for the reply. Half of the questions are formulated a little bit confusing. I think, you're right, though I'm not 100% sure they meant this. I'm going to proceed with this answer. I believe, I had some SQL Server scripts. Do you think, I should include one of them in the reply?

Thanks again.

Do you think, this is good for example?
/****** Object:  Database Credit    Script Date: 3/6/2003 1:55:55 PM ******/
IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'Credit')
	DROP DATABASE [Credit]
GO

CREATE DATABASE [Credit]  ON (NAME = N'CTCredit_Data', FILENAME = N'C:\CreditRecs\Credit_Data.MDF' , SIZE = 20, FILEGROWTH = 10%) LOG ON (NAME = N'Credit_Log', FILENAME = N'C:\CreditRecs\Credit_Log.LDF' , SIZE = 12, FILEGROWTH = 10%)
 COLLATE SQL_Latin1_General_CP1_CI_AS
GO

exec sp_dboption N'Credit', N'autoclose', N'false'
GO

exec sp_dboption N'Credit', N'bulkcopy', N'false'
GO

exec sp_dboption N'Credit', N'trunc. log', N'false'
GO

exec sp_dboption N'Credit', N'torn page detection', N'true'
GO

exec sp_dboption N'Credit', N'read only', N'false'
GO

exec sp_dboption N'Credit', N'dbo use', N'false'
GO

exec sp_dboption N'Credit', N'single', N'false'
GO

exec sp_dboption N'Credit', N'autoshrink', N'false'
GO

exec sp_dboption N'Credit', N'ANSI null default', N'false'
GO

exec sp_dboption N'Credit', N'recursive triggers', N'false'
GO

exec sp_dboption N'Credit', N'ANSI nulls', N'false'
GO

exec sp_dboption N'Credit', N'concat null yields null', N'false'
GO

exec sp_dboption N'Credit', N'cursor close on commit', N'false'
GO

exec sp_dboption N'Credit', N'default to local cursor', N'false'
GO

exec sp_dboption N'Credit', N'quoted identifier', N'false'
GO

exec sp_dboption N'Credit', N'ANSI warnings', N'false'
GO

exec sp_dboption N'Credit', N'auto create statistics', N'true'
GO

exec sp_dboption N'Credit', N'auto update statistics', N'true'
GO

if( ( (@@microsoftversion / power(2, 24) = 8) and (@@microsoftversion & 0xffff >= 724) ) or ( (@@microsoftversion / power(2, 24) = 7) and (@@microsoftversion & 0xffff >= 1082) ) )
	exec sp_dboption N'Credit', N'db chaining', N'false'
GO

use [Credit]
GO

/****** Object:  Table [dbo].[CreditInfo]    Script Date: 3/6/2003 1:55:59 PM ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[CreditInfo]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[CreditInfo]
GO

/****** Object:  Login NADYA\ASPNET    Script Date: 3/6/2003 1:55:55 PM ******/
if not exists (select * from master.dbo.syslogins where loginname = N'NADYA\ASPNET')
	exec sp_grantlogin N'NADYA\ASPNET'
	exec sp_defaultdb N'NADYA\ASPNET', N'master'
	exec sp_defaultlanguage N'NADYA\ASPNET', N'us_english'
GO

/****** Object:  Login NADYA\Guest    Script Date: 3/6/2003 1:55:55 PM ******/
if not exists (select * from master.dbo.syslogins where loginname = N'NADYA\Guest')
	exec sp_grantlogin N'NADYA\Guest'
	exec sp_defaultdb N'NADYA\Guest', N'Credit'
	exec sp_defaultlanguage N'NADYA\Guest', N'us_english'
GO

/****** Object:  Login NADYA\IUSR_NADYA    Script Date: 3/6/2003 1:55:55 PM ******/
if not exists (select * from master.dbo.syslogins where loginname = N'NADYA\IUSR_NADYA')
	exec sp_grantlogin N'NADYA\IUSR_NADYA'
	exec sp_defaultdb N'NADYA\IUSR_NADYA', N'master'
	exec sp_defaultlanguage N'NADYA\IUSR_NADYA', N'us_english'
GO

/****** Object:  Login NADYA\Nadya    Script Date: 3/6/2003 1:55:55 PM ******/
if not exists (select * from master.dbo.syslogins where loginname = N'NADYA\Nadya')
	exec sp_grantlogin N'NADYA\Nadya'
	exec sp_defaultdb N'NADYA\Nadya', N'master'
	exec sp_defaultlanguage N'NADYA\Nadya', N'us_english'
GO

/****** Object:  Login NADYA\Nadya    Script Date: 3/6/2003 1:55:55 PM ******/
exec sp_addsrvrolemember N'NADYA\Nadya', sysadmin
GO

/****** Object:  User dbo    Script Date: 3/6/2003 1:55:56 PM ******/
/****** Object:  User Guests    Script Date: 3/6/2003 1:55:56 PM ******/
if not exists (select * from dbo.sysusers where name = N'Guests' and uid < 16382)
	EXEC sp_grantdbaccess N'NADYA\Guest', N'Guests'
GO

/****** Object:  User NADYA\IUSR_NADYA    Script Date: 3/6/2003 1:55:56 PM ******/
if not exists (select * from dbo.sysusers where name = N'NADYA\IUSR_NADYA' and uid < 16382)
	EXEC sp_grantdbaccess N'NADYA\IUSR_NADYA', N'NADYA\IUSR_NADYA'
GO

/****** Object:  User NADYA\IUSR_NADYA    Script Date: 3/6/2003 1:55:56 PM ******/
exec sp_addrolemember N'db_owner', N'NADYA\IUSR_NADYA'
GO

/****** Object:  Table [dbo].[CreditInfo]    Script Date: 3/6/2003 1:56:00 PM ******/
CREATE TABLE [dbo].[CreditInfo] (
	[credid] [int] IDENTITY (1, 1) NOT NULL ,
	[OriginalID] [int] NOT NULL ,
	[State] [char] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[creditcat] [char] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[credittype] [char] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[misctype] [char] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ccode] [char] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[town] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[county] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[registry] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[city] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[street] [char] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[address] [char] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[searchdate] [datetime] NULL ,
	[price] [int] NULL ,
	[def1fname] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[def1lname] [char] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[def2fname] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[def2lname] [char] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[alias1] [char] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[alias1type] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[pl1fname] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[pl1lname] [char] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[pl2fname] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[pl2lname] [char] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[sheratty] [char] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[phone] [char] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[deposit] [int] NULL ,
	[saledatetm] [datetime] NULL ,
	[saleloc] [char] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[origmortg] [datetime] NULL ,
	[taxtype1] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[taxtype2] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[initdate] [datetime] NULL ,
	[pubdate] [datetime] NULL ,
	[pub] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[respdate] [datetime] NULL ,
	[book] [int] NULL ,
	[page] [int] NULL ,
	[docketref] [char] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[extryear] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[extrweek] [char] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[newspname] [char] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[lientype1] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[lientype2] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[CreditCategory] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[CreditInfo] WITH NOCHECK ADD 
	CONSTRAINT [PK_CreditInfo] PRIMARY KEY  CLUSTERED 
	(
		[credid]
	)  ON [PRIMARY] 
GO

ALTER TABLE [dbo].[CreditInfo] ADD 
	CONSTRAINT [DF_CreditInfo_CreditCategory] DEFAULT ('B') FOR [CreditCategory],
	CONSTRAINT [IX_CreditInfo] UNIQUE  NONCLUSTERED 
	(
		[State],
		[OriginalID]
	)  ON [PRIMARY] 
GO

GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON [dbo].[CreditInfo]  TO [NADYA\IUSR_NADYA]
GO
BTW, I tried to open couple of other scripts and some of them shows some garbage in Notepad (I don't have SQL Server installed).
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform