Forum Replies Created

Viewing 15 posts - 5,041 through 5,055 (of 8,731 total)

  • RE: Help with arithmetic formula to "stuff" digits

    CELKO (4/8/2015)


    I have a column which needs to be 9 digits long. The first four digits are independent from the other digits. The following digits need to be 5 and...

    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: grouping

    Alan, I believe that you missed the important part of the sample data. 😀

    -- sample data

    DECLARE @yourtable TABLE (Clt char(5), Part char(5), Date_a datetime, Val_b decimal(8,2), percent_b varchar(6));

    -- only did...

    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: Help with dynamic SQL

    I think that I found the problem. Is easy to notice it if you format your strings.

    I'm tempted to post the corrected code but I'd love to have the opportunity...

    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: Movie Rental Database

    I wouldn't say that it's completely right, but it's a nice try.

    - The main problem (IMO) is the DVD table. It isn't normalized. I suggest you to create a...

    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: Are the posted questions getting worse?

    Alan.B (4/7/2015)


    Brandie Tarvin (4/3/2015)


    Koen Verbeeck (4/3/2015)


    SqlSanctum (4/3/2015)


    No, it was never rescinded after Vatican II, almost everyone thinks it was though. Even my mother didn't believe me when I told her....

    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: Search a string in a text with number of occurrences

    Just adding a solution that goes a little bit further than Don's.

    WITH

    E(n) AS(

    SELECT n FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) E(n) --10 rows

    ),

    E2(n) AS(

    SELECT...

    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: Help with dynamic SQL

    The "DDL" is not good as we can't use it.

    Some questions:

    Why are you concatenating values instead of parametrizing your queries?

    Are you aware of SQL injection?

    Why are you using RBAR 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: Average number of days between orders

    Alan.B (4/7/2015)


    pietlinden (4/7/2015)


    Found an article at SQLAuthority that covers your options:

    Simulate LEAD() and LAG() without Using SQL Server 2012 Analytic Function[/url]

    This is 2008 forum 😉

    That's why it simulates LEAD...

    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: Help with arithmetic formula to "stuff" digits

    It's easy to test this formula, but that's just the tip of the iceberg on this process. 🙂

    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: Tune SQL Server 2008 Stored procedure

    Maybe changing the splitter function with the DelimitedSplit8K which is available in here:

    http://www.sqlservercentral.com/articles/Tally+Table/72993/

    I'll also go with the recommendation of using RECOMPILE or using dynamic sql as this seems like a...

    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: Help with arithmetic formula to "stuff" digits

    If there are less than 5 digits, it means that there are bigger problems than a formula.

    However, I'll stay with the original because I was trying to improve the process...

    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: Help with arithmetic formula to "stuff" digits

    Thank you both for your solutions.

    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: Want to add databasename in the results.

    Using DB_NAME() is an easy option.

    SELECT DBname= DB_NAME()

    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: Table Join issue

    This might surprise you, but Holidaydate column is now part of the pivot columns.

    SELECT DutyRosterPeriodID,

    StartDate,

    EndDate,

    pvt.HolidayDate,...

    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: JOIN Tables

    Eirikur Eiriksson (4/6/2015)


    Luis Cazares (4/6/2015)


    Or maybe you might need a LIKE in your JOIN clause.

    SELECT

    TB.DiaryID

    ,TA.MedicalCodeID

    FROM dbo.TableA TA

    JOIN dbo.TableB TB ON TB.EmisCode LIKE...

    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 - 5,041 through 5,055 (of 8,731 total)