Viewing 15 posts - 61 through 75 (of 86 total)
declare @t table(
MasterID Int,
SubID varchar(10),
[SubID Price] decimal(5,2)
)
insert into @t values
(1234, 'aa', 1.00),
(1235, 'cc', 4.00),
(1234, 'bb', 0.50)
; with cte
As (
select
t.MasterID
, min(t.[SubID Price]) mp
from
@t t
group by
t.MasterID
having
count(*) > 1)
select
t.MasterID
, t.SubID
, t.[SubID Price]
from
@t...
September 16, 2011 at 4:55 am
azhar.iqbal499
in this case, you have to use "insted of" triger
September 14, 2011 at 5:16 am
insert into #CheckConstraint(ID,Price)
values(2,default)
can you change null value to default in Application?
September 14, 2011 at 4:01 am
try this
create table #t(list varchar(100))
insert into #t(list)
exec xp_cmdshell 'dir /-C "c:\Program Files\Microsoft SQL Server\MSSQL\LOG\sqlagent.out"'
declare @size Int
Select
cast(replace(Substring(t.list, 20, Len(t.list) - 20 - 12), ' ', '') As Int)
From
#t t
Where
CharIndex('sqlagent.out',...
September 14, 2011 at 3:23 am
SUBSTRING (Transact-SQL)
Returns part of a character, binary, text, or image expression
SUBSTRING (value_expression ,start_expression ,length_expression )
length_expression
Is a positive integer or bigint expression that specifies how many characters of the value_expression will...
October 19, 2010 at 2:38 am
i dont know
do this
create index ix1 on #tempCDI(CDIID)
and try again
August 6, 2010 at 1:21 am
ok
problem is here
UPDATE CDI
SET statustypeid = t.statustypeid
FROM #tempCDI t
INNER JOIN DBO.CDI CDI ...
August 4, 2010 at 10:45 pm
How many records in the table?
Check up statistics and indexes
August 4, 2010 at 5:43 am
select top 1 address from loca where loca.sno=main.sno
add order by ...
and queries wiil be identical
August 4, 2010 at 3:56 am
select
t1.tabPrtId
, t1.tabSlab
, t2.tabSlab
from
@t t1
left join @t t2 on t2.tabid = t1.tabid + 1 and t2.tabPrtId = t1.tabPrtId
or
select
t1.tabPrtId
, t1.tabSlab
, min(t2.tabSlab)
from
@t t1
left join @t t2 on t2.tabid > t1.tabid and...
August 4, 2010 at 3:21 am
try this
UPDATE DBO.MEASURE
SET statustypeid = t.statustypeid
FROM #tempFinalMeasure t
WHERE
DBO.MEASURE.measureid=t.measureid AND DBO.MEASURE.statustypeid <> t.statustypeid
August 4, 2010 at 3:13 am
Yes.DB Recovery model is Full, Sql Server 2000
in this case you have to make backup db and after backup log wtih TRUNCATE_ONLY options
August 4, 2010 at 3:00 am
is this?
declare @test1 table(a int)
declare @test2 table(a int)
insert into @test1(a)values(1)
insert into @test1(a)values(2)
insert into @test1(a)values(3)
insert into @test1(a)values(4)
insert into @test2(a)values(10)
insert into @test2(a)values(20)
DECLARE...
February 27, 2010 at 5:28 am
1.
select
p.ProductId
, p.ProductName
, p.CategoryId
from
Product p
where
p.CategoryId = 1
and (select count(distinct DescriptorValueId) from ProductDescriptorMapping pdm where pdm.ProductId = p.ProductId and pdm.DescriptorValueId in (1,2,3)) = 3
2.
select
p.ProductId
, p.ProductName
, p.CategoryId...
February 26, 2010 at 11:23 pm
Viewing 15 posts - 61 through 75 (of 86 total)