Showing posts with label idea. Show all posts
Showing posts with label idea. Show all posts

Tuesday, March 20, 2012

adding support for user defined functions to the ssis expression language

good idea or bad idea?

Oh yes. A very very very very very very good idea. And if you want an example of why - read this: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=564759&SiteID=1&mode=1

and add a comment to Mahesh's Connect posting here: http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=166356

-Jamie

|||

Jamie Thomson wrote:

Oh yes. A very very very very very very good idea. And if you want an example of why - read this: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=564759&SiteID=1&mode=1

and add a comment to Mahesh's Connect posting here: http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=166356

-Jamie

actually, i got this idea after reading mahesh's thread. so, i went ahead and already created a connect suggestion: https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=166367

Saturday, February 25, 2012

Adding line sequence numbers

hi all

I am stuck with something that seems easy but im obviously clueless as how to execute the idea.

I have a custom table that houses invoices on the details level. So for example i have:

InvcNo
00000001
00000001
00000001
00000002
00000002
00000003

and so forth

What I am wanting to do in another column is keep track of the sequence number for each distinct invoice like:

SeqNo
1
2
3
1
2
1

I am working in a stored proc and i cant get past adding the numbers up at each line as a whole and not reseting when the next invoice number is present. Any help would be so greatly appreciated.

ThanksWill this help?
http://www.sqlservercentral.com/columnists/mcoles/sequentialordering.asp|||Thanks...but I dont have 2005 (

Is it possible to pull the example that is given in 2005 section in a prior version of SQL?|||Can you uniquely identify each record for a specific InvcNo?|||Yes, I have an InvcKey column set up|||create table #t1 (InvcKey int, InvcNo int)
insert into #t1 select
1,1 union all select
2,1 union all select
3,1 union all select
4,2 union all select
5,2 union all select
6,3

select count(*) 'SeqNo', a.InvcKey, a.InvcNo from #t1 a, #t1 b
where a.InvcNo=b.InvcNo
and a.InvcKey>=b.InvcKey
group by a.InvcKey, a.InvcNo

drop table #t1|||Ok, Ive got it...I should have played around some before asking further

SELECT COUNT(*) AS [SeqNo], c.InvcNo, c.InvcKey
FROM table c, table d
WHERE d.InvcKey <= c.InvcKey AND d.InvcNo = cInvcNo
GROUP BY c.InvcNo, c.InvcKey
ORDER BY c.InvcKey

Thanks for the help!

tibor|||You should probably use a JOIN.
Using

FROM table1, table2, ... , tableN

Is not advised.|||Being a self join, would I really need JOIN?|||Being a self join, would I really need JOIN?It is semantics. The affect it the same but the style you used is considered old fashioned in many quarters. Whether or not it is a self join is irrelevent.

Rather excitingly - you will have created a Theta Join when you have finished :)|||Rather excitingly - you will have created a Theta Join when you have finished :)

neat! normally you'd have to pay $360k to get to that level (http://en.wikipedia.org/wiki/Operating_Thetan)!