Click here to Skip to main content
15,884,353 members
Articles / Web Development / HTML

Saving DB Access in Online Market

Rate me:
Please Sign up or sign in to vote.
4.00/5 (1 vote)
26 Jun 2008CPOL4 min read 27.7K   169   20  
A CACHING technique for data that changes in a strict cycle
USE  master
go 

CREATE DATABASE [panther]
go 

use panther
go 
exec sp_addlogin 'dev', 'dev', 'panther'
go 
exec sp_grantdbaccess 'dev'
go 
exec sp_addrolemember 'db_datareader', 'dev'
go

CREATE TABLE [CarSpecTbl] (
	[CarNo] [int] IDENTITY (1000,1) PRIMARY KEY ,
	[Model] [varchar] (50) NOT NULL ,
	[Maker] [varchar] (50) NOT NULL ,
	[Derivative] [varchar] (50) NOT NULL ,
	[Price] [money] NOT NULL ,
	[Spec] [varchar] (2000) NOT NULL ,
	[Reg_dt] [datetime] NOT NULL default(getdate())
) 

--drop table CarSpecTbl
go

insert into CarSpecTbl ( model, maker, Derivative, price, Spec) 
values ( 'Tt Roadster', 'Audi', '2.0T FSI 2dr', 50000, '<table><tr><td><img src="http://www.buyyourcar.co.uk/images/capimages/120x90/audi_tt-roadster_2-0t-fsi-2dr_36533.jpg"></td></tr><tr><td>Audi Roadster - Amazing Car</td></tr></table>' )

go 
insert into CarSpecTbl ( model, maker, Derivative, price, Spec) 
values ( 'C30 Sports Coupe', 'Volvo', '2.0 SE 3dr', 36000, '<table><tr><td><img src="http://www.buyyourcar.co.uk/images/capimages/120x90/volvo_c30-sports-coupe_2-4i-se-3dr_35547.jpg"></td></tr><tr><td>I love C30</td></tr></table>' )

go 
--select carno, model, maker, derivative, price, spec, reg_Dt from CarSpecTbl where carno = 1000
select * from CarSpecTbl

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader An Online Market
Korea (Republic of) Korea (Republic of)
Software engineer having worked 8 years.
The main skill would be C++, ATL, COM
But for the past three years I have been digging on Web service related skill - .Net MS-SQL etc in current company.
My other interest is business, playing traditional music, dealing with people and evolutionary biology.

Comments and Discussions