Viewing 15 posts - 91 through 105 (of 444 total)
divyang_dv 42143 (11/17/2015)
November 18, 2015 at 1:46 am
No, you stated it absolutly clear, separate sequence for each tenat. And this will generally allow for the same invoice number =123 to emerge for different tenats.
That's my question, why...
November 17, 2015 at 5:24 am
divyang_dv 42143 (11/17/2015)
I am thinking to create a Sequence object for each Tenant to generate an invoice number, because each tenant should have their own set of invoice numbers.
This...
November 17, 2015 at 4:46 am
My guess is 2 (value, defaultValue) ** 3 (number of rows) = 8
select [@YY],[@XX],[@ID]
from
(select v as [@ID]
from #Param
cross apply(values (value),(DefaultValue) ) t(v)
where Name ='@ID') _1,
(select v as [@XX]
from #Param
cross...
November 16, 2015 at 3:38 am
See this discussion for how to build polygon from points
Also i'd aggregated polygon expression from points with FOR XML PATH('') rather them loop.
All the rest is rather straightforward.
November 6, 2015 at 3:26 am
Just date and integer arithmetic version
create function retailWeekNumbers(@dt date)
returns table
as
return select
[Year]
,[Week] = datediff(day
,dateadd(day, (t1.ws - datepart(weekday,YStartDt) -7) % 7, YStartDt) -- first week start
,@dt) / 7 +...
November 4, 2015 at 3:41 am
See this paper for accounting database design. I haven't found original publication by Michael Wigley.
November 3, 2015 at 5:01 am
tshad (11/3/2015)
I was looking at both solutions as I am not sure which I will need until tomorrow.
Ok, then count them and decide.
declare @stemp varchar(50);
select @stemp = 'fl,ca';
with...
November 3, 2015 at 1:43 am
Try this query which utilises Left Anti Semi Join in its execution plan
--All the rows that have all of the states from a comma delimited parameter.
declare @stemp varchar(50);
select @stemp =...
November 3, 2015 at 12:59 am
So you need traverse menu hierarchy . Under above setup the
hierarchy CTE will do.
with hc as (
select menuCollection_idx, parentID
from [myMenuCollection]
where menuCollection_idx in (1,4,11)
union all
select mc.menuCollection_idx, mc.parentID
from [myMenuCollection]...
November 2, 2015 at 5:45 am
If you need the procedure to behave differently within the same run you need to place
SET @stoptime = CONVERT( CHAR(8), GetDate(), 14);
within the WHILE loop too .
October 30, 2015 at 7:32 am
alan.cdes (10/30/2015)
Order by rate.
Output the ordered colum name on comma delimited list.
Insert the comma delimited list...
October 30, 2015 at 3:37 am
Your last FETCH is beyond of WHILE loop. Is it what you really mean? Try
CREATE PROCEDURE procedure1
AS
DECLARE cursor_1 CURSOR FOR
SELECT
'This is a executable query'
FROM table_1
DECLARE @table_2
DECLARE...
October 30, 2015 at 2:59 am
ramrajan (10/9/2015)
I have mentioned detailed explanation about the requirement
Try
with allRatings as (
select * from [dbo].[InputTest1]
union all
select *
,[FormOrderForInstnRating] =
(select top(1) FormOrderForInstnRating from [dbo].[InputTest1] t1
where t2.[CreditRatingTranche] =t1.[CreditRatingTranche])
,[SortOrder] = 1+row_number() over(partition by [ShortestName],[CreditRatingTranche]...
October 9, 2015 at 2:54 am
May be as simple as the query below. Or may be not. 🙂
with allRatings as (
select * from [dbo].[InputTest1]
union all
select *
,null as [FormOrderForInstnRating]
,null as [SortOrder]
from [dbo].[InputTest2]
), nbr as (
select *
,rn...
October 9, 2015 at 2:07 am
Viewing 15 posts - 91 through 105 (of 444 total)