Viewing 15 posts - 3,286 through 3,300 (of 3,544 total)
Unfortunately not. The use of GO splits queries into batches and a proc can only be one batch. BOL states that 'A table cannot be altered and then the new...
Far away is close at hand in the images of elsewhere.
Anon.
May 27, 2003 at 5:23 am
Can u be more specific. With a left outer join the first result be be null if there is no data match! Can u post samples?
I did post this on...
Far away is close at hand in the images of elsewhere.
Anon.
May 27, 2003 at 3:15 am
Could use
select distinct m.cola,m.colb from maintable m
inner join othertable x on x.key = m.key
or
select m.cola,m.colb from maintable m
inner join (select distinct key from othertable) x on x.key = m.key
Far away is close at hand in the images of elsewhere.
Anon.
May 27, 2003 at 3:05 am
Insert GO between your statements,as in
set nocount on
if not exists (select column_name from information_schema.columns where column_name='RG_ENTRYDELETED' and table_name='REGISTRATION')
alter table REGISTRATION add RG_ENTRYDELETED bit
GO
if not exists (select column_name from information_schema.columns...
Far away is close at hand in the images of elsewhere.
Anon.
May 27, 2003 at 2:48 am
Are you checking for the day (dd) or the whole date (yyyy-mm-dd) in your where clause.
If you want to use the full date then try
Declare @date datetime,@monthend DateTime
Set @date='23 may...
Far away is close at hand in the images of elsewhere.
Anon.
May 23, 2003 at 7:30 am
Beware that the date/time format is dependant on several things. NT/2000, version of IIS, whether a user is logged in or not, whether users are impersonated, the system default locale....
Far away is close at hand in the images of elsewhere.
Anon.
May 23, 2003 at 3:07 am
create table #zipsum (zip Varchar(5) null,CountPerZip int)
insert into #zipsum values (12345, 5)
insert into #zipsum values (23456, 4)
insert into #zipsum values (23457, 2)
insert into #zipsum values (11111, 1)
insert into #zipsum values...
Far away is close at hand in the images of elsewhere.
Anon.
May 22, 2003 at 8:06 am
create table tblTempZips2 (zip Varchar(15) null, id int primary key IDENTITY (1,1) not null )
insert into tblTempZips2 (zip)
select zip+' x '+cast(count(*) as varchar) from tblTempZips group by zip order by...
Far away is close at hand in the images of elsewhere.
Anon.
May 22, 2003 at 7:21 am
Create another table from this one with distinct zip values and run the same query on the new table.
Far away is close at hand in the images of elsewhere.
Anon.
May 22, 2003 at 6:47 am
declare @c int
select @c = ceiling(count(*) / 3.0) from tblTempZips
select a.zip as zip1,b.zip as zip2,c.zip as zip3
from tblTempZips a
left outer join tblTempZips b on b.id = (a.id + @c)
left outer...
Far away is close at hand in the images of elsewhere.
Anon.
May 22, 2003 at 5:50 am
Can u post table structure, small sample of data (non sensitive) and exactly what output you expect.
Far away is close at hand in the images of elsewhere.
Anon.
May 22, 2003 at 4:34 am
If the ids are consecutive and want 3 cols then
declare @c int,@i int
select @i = count(*) from #t
set @c = ceiling(@i / 3.0)
select [id] as id1,
(case when [id]+@c > @i...
Far away is close at hand in the images of elsewhere.
Anon.
May 22, 2003 at 2:56 am
Bear in mind on SQL7 you 'Cannot group by a bit column', don't know about 2000 though. You would have convert it or use case to do it.
Far away is close at hand in the images of elsewhere.
Anon.
May 20, 2003 at 6:29 am
Probably of no help as I have not done this and I am probably barking up someone else's tree but two things spring to mind.
Are the NT Groups in the...
Far away is close at hand in the images of elsewhere.
Anon.
May 20, 2003 at 6:21 am
Thanks for that Frank, will bear it in mind. We are still on SQL7 but now looking at future strategy for SQL.
Far away is close at hand in the images of elsewhere.
Anon.
May 19, 2003 at 3:34 am
Viewing 15 posts - 3,286 through 3,300 (of 3,544 total)