Viewing 15 posts - 16 through 30 (of 46 total)
Some changes
DECLARE @CYBeginDate smalldatetime, @CYEndDate smalldatetime,
@LYBeginDate smalldatetime, @LYEndDate smalldatetime
select @CYBeginDate = dateadd(year, datepart(year, getdate()) - 1900, '1900-04-01')
select @CYEndDate = dateadd(day, -1, dateadd(month, 12, @CYBeginDate))
select @LYBeginDate = dateadd(year, -1, @CYBeginDate)
select...
December 28, 2010 at 12:22 am
Hi
Just a bit simplified version of Nakul Vachhrajani's code
DECLARE @CYBeginDate datetime, @CYEndDate datetime, @LYBeginDate datetime, @LYEndDate datetime
select @CYBeginDate = dateadd(year, datepart(year, getdate()) - 1900, '1900-04-01')
select @CYEndDate = dateadd(day, -1,...
December 27, 2010 at 11:39 pm
If you want to check the status of SQLAgent
then check whether this query works or not
xp_servicecontrol querystate , SQLAGENT
December 26, 2010 at 11:48 pm
what is the rowcount of the table?
December 23, 2010 at 4:52 am
Hi kingston
Thanks for the reply
Actually the whole idea of my posting this problem was to not to use dynamic SQL.
Thanks again
December 22, 2010 at 11:18 pm
Thank you very much for the solution.
Sometimes there is a very easy solution for a complicated problem and we just cant think of it
Thanks again.
December 22, 2010 at 11:08 pm
Thanks for the feedback.
It was my pleasure to help.
And no need to thank me as i have also got many solutions from this site so just doing my part to...
December 22, 2010 at 11:06 pm
Thanks for the reply
But sorry i didn't gave a complete idea of the problem
The problem is like this
Declare @tab1 table (ID int, Name varchar(10))
insert into @tab1 values (1, 'One')
insert into...
December 22, 2010 at 10:38 pm
this will solve the problem. Here i have used rownumber to find the lowest priority and rowid.
Declare @priorityupdate table
( aid int,
priority int,
rowid int,
Transaction_V nvarchar(1))
Insert into @priorityupdate(aid,priority,rowid) values(1234,2,2)
Insert into @priorityupdate(aid,priority,rowid)...
December 21, 2010 at 10:03 pm
Please post some DDL data
December 21, 2010 at 1:01 am
Assuming ID column of hdr table is identity , as u havent given any details about it.
Declare @dtl table (id Int, fk Int, dtl_note varchar(100))
insert into @dtl
values (1,1,'first')
insert...
December 15, 2010 at 2:30 am
thanks GilaMonster
those are really good articles.
December 14, 2010 at 11:33 pm
XML can help u in this.
Get those external files in XML if possible. As in xml u can tag the values. this will definitely solve your problem.
December 14, 2010 at 5:32 am
You are using different sets of table in each query. there is no scope in further optimization.
Only chance remain is that if you can check the indexes and optimize it.
December 14, 2010 at 5:19 am
Viewing 15 posts - 16 through 30 (of 46 total)