Viewing 15 posts - 256 through 270 (of 398 total)
Here is the way.
select EventNumber, EventNameID, min(StartDate) StartDate, max(EndDate) EndDate
group by EventNumber, EventNameID
You may have to finish it by puting identity column at the beginning.
March 20, 2004 at 7:06 pm
Here is the test case.
create table test(id int, sku varchar(5), qty int)
insert test values(1,'ABC',2)
insert test values(1,'EFD',1)
insert test values(2,'SFG',2)
insert test values(3,'FGE',2)
insert test values(3,'ABV',3)
insert test values(3,'JKL',2)
GO
select * from test
go
create function fnsku (@id...
March 20, 2004 at 2:54 am
One way of doing Sales_By_Immediate_Child:
You may want to finish Sales_By_Immediate_Child_Type. Let me know if having difficult.
create proc Sales_By_Immediate_Child
(
@EntityID varchar(30),
@EntityTypeID int
)
AS
set nocount on
declare @ChildEntityID varchar(30), @ChildEntityTypeID int
declare @Result table ([Sales_By_Immediate_Child]...
March 19, 2004 at 11:04 pm
GetDate() if the function in T-SQL to return Now value.
You can use default to get value inserted into table without mention the column name.
For detail information, check BOL (book online)...
March 19, 2004 at 3:02 am
self join case:
select a.memberNbr, a.effectivedate commentstartdate, min(b.effectivedate) commentenddate, a.comment
from table a
left outer join table b on a.memberNbr = b.memberNbr and a.effectivedate < b.effectivedate
group by a.memberNbr, a.effectivedate, a.comment
order by a.effectivedate
Here assume...
March 19, 2004 at 2:55 am
Base on the sample.
create function fnTerminalEntityID (@EntityID varchar(30), @EntityTypeID int)
returns @TerminalEntity table (EntityID varchar(30), EntityTypeID int)
as
begin
declare @level int
declare @stack table (entityid varchar(30), entitytypeid int, level int)
insert into @stack values(@EntityID, @EntityTypeID,...
March 19, 2004 at 1:50 am
put nolock after all table name. Or set isolation level to read uncommitted.
March 18, 2004 at 12:57 am
The first method is actually file=1.
Try to restore whole file in one go, you have to restore every file in the log.
Use restore header only to get number of files...
March 17, 2004 at 8:09 pm
Try to update statistics, then run the query again.
March 17, 2004 at 7:57 pm
If running from query analyzer, you can turn it off by click tools in menu, options, results, clean Print column headers(*) check box.
If running from osql, -h-1 is the answer.
March 17, 2004 at 4:32 am
It is not necessary to put dll in 'path'.
Registers the extended stored procedure with following, specify dllname with full path.
sp_addextendedproc [ @functname = ] 'procedure' ,
[ @dllname = ]...
March 17, 2004 at 12:04 am
create function fn_cleanup (@i varchar(4000))
returns varchar(4000)
as
begin
declare @return varchar(4000)
set @return = @i
while patindex('%[^a-zA-Z0-9]%', @return) != 0
begin
select @return=replace(@return, substring(@return, patindex('%[^a-zA-Z0-9]%', @return), 1), '')
end
return...
March 16, 2004 at 5:11 pm
Did the error message mention which object failed to allocate space?
Try to create an user filegroup as default and run the script (if create object statements do not have primary hard coded).
March 16, 2004 at 4:18 am
Viewing 15 posts - 256 through 270 (of 398 total)