Forum Replies Created

Viewing 15 posts - 7,186 through 7,200 (of 8,731 total)

  • RE: ProperCase Function

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: find the count of rows all tables based on created date

    Something like this would help?

    DECLARE @Datedate = GETDATE(),

    @sql nvarchar(max)

    SELECT @sql = (SELECT 'SELECT ''' + TABLE_NAME + ''', COUNT(*) FROM ' + TABLE_NAME + ' WHERE CreateDate >= ''' +...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: We're not craftsmen and craftswomen

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: looking for way to unpivot a table, and make field name one of the columns in the output

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: looking for way to unpivot a table, and make field name one of the columns in the output

    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,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: looking for way to unpivot a table, and make field name one of the columns in the output

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: looking for way to unpivot a table, and make field name one of the columns in the output

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Where we can download SQL Server 2008

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: looking for way to unpivot a table, and make field name one of the columns in the output

    You can try UNPIVOT or CROSS APPLY VALUES[/url]

    It really depends on what will work for you.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Create Ledger using Store procedure or View

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Group Ranges First and Last values

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: column and input withCSV

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Select statement result set to large

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: exiting a stored procedure

    You could use @@ROWCOUNT to validate resultset and GOTO or RAISEERROR to stop the procedure.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: We're not craftsmen and craftswomen

    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...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 7,186 through 7,200 (of 8,731 total)