Viewing 15 posts - 7,186 through 7,200 (of 8,731 total)
Hi,
I'm not sure what your GetNums function looks like. I used the DelimitedSplit8K which you can find in the following article which explains how it works. http://www.sqlservercentral.com/articles/Tally+Table/72993
Here's my option for...
January 16, 2014 at 9:24 am
Something like this would help?
DECLARE @Datedate = GETDATE(),
@sql nvarchar(max)
SELECT @sql = (SELECT 'SELECT ''' + TABLE_NAME + ''', COUNT(*) FROM ' + TABLE_NAME + ' WHERE CreateDate >= ''' +...
January 16, 2014 at 8:47 am
Gary Varga (1/16/2014)
Luis Cazares (1/15/2014)
Tom Bakerman (1/15/2014)
Luis Cazares (1/15/2014)
In my experience, doing just enough to complete a job has resulted (most of the times) in errors that require extra work...
January 16, 2014 at 8:07 am
nonghead-webspam (1/15/2014)
And I just found "select / union all" will only work up to 19 iterations, and after that it starts saying it can't find columns.
I just tried to reproduce...
January 15, 2014 at 3:42 pm
Here's an example using the VALUES clause instead of UNION ALLs on the CROSS APPLY approach.
SELECT Part#, CustomerID, ca1.Wk_Num, ca1.Qty
FROM MyTable
CROSS APPLY (
VALUES(1,Wk1),
(2,Wk2),
(3,Wk3),
(4,Wk4),
--...
(52,Wk52)
) AS ca1(Wk_Num,...
January 15, 2014 at 3:31 pm
nonghead-webspam (1/15/2014)
also, to whomever, some code examples regarding exactly what I'm trying to do would be helpful.Thanks.
Code examples are available in the links I provided. To get code examples that...
January 15, 2014 at 1:35 pm
For unpviot, you might need to use a substring to get the week number and then cast it to the correct data type.
I have nothing to test, but it might...
January 15, 2014 at 1:33 pm
I'm not sure about this, but you should think of migrating to 2012 for licensing issues. If Microsoft has removed the option to download it, it's very possible that it...
January 15, 2014 at 1:18 pm
You can try UNPIVOT or CROSS APPLY VALUES[/url]
It really depends on what will work for you.
January 15, 2014 at 12:42 pm
I guess this could help you get started and then follow a running total option such as the Quirky Update[/url].
SELECT ItemID, [InwardDate] AS [Date], [ItemName], [Qty] AS Inward, 0 ASOutward
FROM...
January 15, 2014 at 12:39 pm
As I understood, it's not about consecutive lot_nbr values. It's about the groups for owner id resulting when you order by lot_nbr.
If you run the following query, it should become...
January 15, 2014 at 12:03 pm
Here's an idea. Notice that I'm including DDL and sample data as you should have done to get faster and better answers.
I'm using a function that you can find in...
January 15, 2014 at 11:39 am
You have a cross join with dbo.dealer. Is that correct? I suggest you to change the syntax to have only ANSI-92 joins.
For better help, please post DDL and sample data...
January 15, 2014 at 11:18 am
You could use @@ROWCOUNT to validate resultset and GOTO or RAISEERROR to stop the procedure.
January 15, 2014 at 11:10 am
Tom Bakerman (1/15/2014)
Luis Cazares (1/15/2014)
In my experience, doing just enough to complete a job has resulted (most of the times) in errors that require extra work and more time invested...
January 15, 2014 at 11:05 am
Viewing 15 posts - 7,186 through 7,200 (of 8,731 total)