Viewing 15 posts - 3,781 through 3,795 (of 10,144 total)
skb 44459 (1/7/2014)
I need multiple SubRoutines within One Stored Procedure, so that they can share the Variables and...
January 7, 2014 at 8:17 am
Truncating the table before loading new data would be more efficient - is there some reason why you chose the CTE instead?
January 7, 2014 at 7:34 am
petr.caslavka (1/7/2014)
This will work great. thank you very much for your help,Petr
Which option?
January 7, 2014 at 7:10 am
Yes you can - stored procedures with input and output parameters can be nested within a calling stored procedure. Do you really need the code blocks configured as "subroutines"?
January 7, 2014 at 7:08 am
Something like this:
DECLARE @NextSeqId INT
SET @NextSeqId = dbo.FN_GetNextSeqId4CRM_MNP_ORIGINAL_NRN()
;WITH CTEseriesnacionales AS (
SELECT NextSeqId = @NextSeqId + (ROW_NUMBER() OVER(ORDER BY RangoIni)-1),
*
FROM dbo.seriesnacionales
)
MERGE dbo.CRM_MNP_ORIGINAL_NRN AS T
USING CTEseriesnacionales AS S
ON (T.RANGE1 = S.RANGOINI )
...
January 7, 2014 at 7:04 am
Working on a completely different principle, this will perform differently to Luiz' fine solution. Test them and assuming they return correct values, choose the fastest - on the assumption that...
January 7, 2014 at 6:46 am
A slightly different approach from the previous two, triggered by a gruelling telephone survey I was foolish enough to agree to participate in just a couple of weeks ago. There...
January 7, 2014 at 2:09 am
joey6401c (1/6/2014)
I modified my query but it returns an error
Delcare @dt date
Set @dt = GETDATE()
select distinct v1.name 'Machine Name', v1. 'Username', t1.displayname 'Unlicensed Application', t1.installdate 'Install Date'...
January 6, 2014 at 9:03 am
waheed71 (1/6/2014)
...Let me explore this in more details...
That's the ticket!
Thanks for the feedback.
January 6, 2014 at 8:34 am
waheed71 (1/6/2014)
Dear Chris,Thank you. Can you please give me example of below text.
Change the join column on my query to whichever MAX column fits your requirement.
Sure.
Change this:
INNER JOIN ST_SUPPLIER su...
January 6, 2014 at 8:19 am
waheed71 (1/6/2014)
Thanks for the prompt reply. I am really sorry about not able to communicate properly. So far I am unable to get required result.
I just...
January 6, 2014 at 8:04 am
If you haven't got a timestamp date/time column in your table, how can you tell if something is more than 7 days old?
Does your table have an assocoation with any...
January 6, 2014 at 7:02 am
Slightly different to Lowell's code and I'm not sure which is correct:
SELECT
d.TR_STOCKNO,
d.CT_STOCKSUMMARY,
d.PH_SUPPLIERCODE,
su.SU_SUPPLIERNAME,
d.PH_RAISEDDATE,
d.TR_DATE,
d.LASTPO,
d.LASTVENDOR,
d.LASTGRN,
d.Age
FROM (
SELECT
tr.TR_STOCKNO,
ct.CT_STOCKSUMMARY,
ph.PH_SUPPLIERCODE,
--SU_SUPPLIERNAME,
ph.PH_RAISEDDATE,
tr.TR_DATE,
MAX(ph.PH_RAISEDDATE) OVER (PARTITION BY tr.TR_STOCKNO) AS LASTPO,
MAX(ph.PH_SUPPLIERCODE) OVER (PARTITION BY tr.TR_STOCKNO) AS LASTVENDOR,
MAX(TR_DATE) OVER (PARTITION...
January 6, 2014 at 6:53 am
ROW_NUMBER() on an outer SELECT will often return the results in the ROW_NUMBER() order, which could make your query equivalent to this:
SELECT rownumber, linknumber, savabegh
FROM (
SELECT
rownumber = ROW_NUMBER()...
January 6, 2014 at 6:30 am
The splitter discussed here [/url]is shown to be far superior in performance terms to either of the two already listed oon this thread. Here's how you would use it to...
January 6, 2014 at 3:31 am
Viewing 15 posts - 3,781 through 3,795 (of 10,144 total)