🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.databases
Article #173

Re: SQL-Queries

#173
From: steve Robinson
Date: Mon, 20 Oct 1997 00:00
55 lines
2483 bytes
Heinz,

Here are the answers you requested :

1. SELECT titel FROM database WHERE upper(titel) LIKE '%APPLE%' 
2. The way to do this is to select the data into a temp table.  Then append
a column to the table of type identity.  The numbers will be assigned
automaticaly and you can select where the identity value = 4162 - Here is
the code


create table test1 (
test1 char(3)
)
go
insert into test1 values ("X")
insert into test1 values ("XX")
insert into test1 values ("XXX")
go

drop proc TP1 
go
create proc TP1 @tablename varchar(30),@RecordNo int as
declare @RecordNo2 varchar(30)
if exists (select * from tempdb..sysobjects where name = "##test")
drop table ##test
exec ("select * into ##test from "+@tablename)
exec ("alter table ##test add Ident int identity")
select @RecordNo2 = convert(varchar,@RecordNo)
exec ("select * from ##test where identitycol = "+@RecordNo2)

exec TP1 "test1", 3

3.  There are a number of good books and Mags you can look at for details
of SQL on the Web.  It depends on the way you are connecting to the sql
server and what your web server will be.  For IDC try SQL Server unleashed
this is a simple way to get connected and very flexible - I have
implemented an intranet using this method.  For mags look at either
windowsNT Mag at www.winntmag.com or Microsoft Interactive developer at
www.microsoft.com/mind  Lots of great stuff at both sites.

As for more questions - please post as many as possible.  Its a public
forum and I bet If you are having a problem then there are 10 of us out
here having the same one.  If you require code for any of the above please
contact me.


-- 
I hope this was of use to you

Steve Robinson MCP (SQL /NT)

Steve@Samurai1.demon.co.uk
 
Technical Details
Message-ID: <01bcdd73$57e87180$14c8a8c0@simon>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <344B1EAD.E25@fbch.tuwien.ac.at>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ffff5,c6b02df51994e2b0
X-Google-Attributes: gidffff5,public
X-Google-Thread: 10de66,c6b02df51994e2b0
X-Google-Attributes: gid10de66,public
X-Google-Thread: 11301e,c6b02df51994e2b0
X-Google-Attributes: gid11301e,public
From: "steve Robinson" <steve@samurai1.demon.co.uk>
Subject: Re: SQL-Queries
Date: 1997/10/20
Message-ID: <01bcdd73$57e87180$14c8a8c0@simon>
X-Deja-AN: 282037516
X-NNTP-Posting-Host: mailgate.bluearrow.co.uk [194.159.238.98]
References: <344B1EAD.E25@fbch.tuwien.ac.at>
Organization: Blue Arrow
Newsgroups: comp.lang.pascal.delphi.databases,borland.public.delphi.database.sqlservers,microsoft.public.sqlserver.programming