Forum Replies Created

Viewing 15 posts - 6,586 through 6,600 (of 8,731 total)

  • RE: Find and Replace Injection String in Server 2005

    Lynn Pettis (4/7/2014)


    First, I have never used IronSpeed, but I take exception to you blaming the tool. It comes down to the person using the tool not knowing how...

    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: Insert Into with nested Selects

    Sean is right, you're overcomplicating things. You can use INSERT INTO...SELECT instead of values.

    INSERT INTO dbo.HemTransfer (

    TraTrtId

    ,TraAniId

    ,TraDate

    )

    SELECT 2

    ,ha.AniId

    ,ha.AniBirthday

    FROM HemAnimal ha --This is a guess

    WHERE ha.AniUserNumber = 123456

    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: COUNT of values in a column

    You might be overcomplicating yourself. Grouping by page will give you one row per page value. Using COUNT(DISTINCT column) will count for each unique value.

    You'll end up with a code...

    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?

    Sean Lange (4/7/2014)


    Ed Wagner (4/7/2014)


    Sean Lange (4/7/2014)


    Greg Edwards-268690 (4/7/2014)


    Sean -

    Is the grass green?

    I still see white and brown around here. 🙂

    Sad about the refs - kids need to learn...

    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: Syntax Validation

    I was expecting to use an explicit transaction that will roll back at the end of the code within a try...catch block. This might not be the best option all...

    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: generate insert statement from table

    djj (4/7/2014)


    Why would you want to scan the table four times when you can do it just once?

    Because I forget about CROSSAPPLY as I have not used it as often...

    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: generate insert statement from table

    djj (4/7/2014)


    This will do the same thing:

    Why would you want to scan the table four times when you can do it just once?

    CREATE TABLE #Test( customnr int, number int, wk...

    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: generate insert statement from table

    How do you differentiate customnr & number from wk1, wk2, wk3, etc.?

    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: how to update value from c2 to c1

    This might work for you. You should study about recursive CTEs to understand what it is doing.

    If you have questions, please ask them.

    WITH rCTE AS(

    SELECT Id

    ,[NewId]

    ,1 AS n

    FROM #Temp1

    UNION...

    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: Function and variables

    Can you post your variables declaration?

    You might have a truncation problem. Check the following code that looks the same but has an important difference.

    DECLARE @ExtType varchar(10) = 'X',

    @PhoneNo varchar(20) =...

    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: Very simple join query that is puzzling me

    Sarah Wagner (4/4/2014)


    Try this...

    SELECTpd.year,

    pd.period,

    pd.startdate,

    df.projectnumber,

    df.startdate_contract,

    df.enddate_contract,

    MONTH(df.startdate_contract) AS month

    FROMperdat pd (NOLOCK)

    LEFT OUTER JOIN ProjectDateFields df (NOLOCK) ON df.startdate_contract BETWEEN pd.startdate AND pd.enddate

    and df.projectnumber = 'CR1003753'

    Or try it without the NOLOCK hints which will...

    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: Combining multiple rows into one row per employee

    What's your problem? You just need to remove the CTE and replace it with your table. You've mentioned that on the comments, so I can't see the problem.

    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: Combining multiple rows into one row per employee

    That's a horrible way to do it. You're reading the table 4 times instead of one.

    I gave you an example and an article that fully explains that method.

    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: Combining multiple rows into one row per employee

    Check the following article on Cross Tabs: http://www.sqlservercentral.com/articles/T-SQL/63681/

    WITH SampleData (PERSON, [DATA], [FIELD]) AS

    (

    SELECT 1234,'04/02/2014','Date'

    UNION ALL SELECT 1234,'123','Department'

    UNION ALL...

    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: Convert "TinyInt" into Binary format and store the multiple bit values in columns

    You need to cast Interval to a varchar value.

    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 - 6,586 through 6,600 (of 8,731 total)