Forum Replies Created

Viewing 15 posts - 4,966 through 4,980 (of 8,731 total)

  • RE: Are the posted questions getting worse?

    Lynn Pettis (5/7/2015)


    Catch the comment in this post: http://www.sqlservercentral.com/Forums/FindPost1683559.aspx

    The problem is that this newborn isn't really a newborn, but keeps asking questions and making comments that show that he hasn't...

    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: Need Help With Conditional Logic Function

    Sergiy (5/4/2015)


    I'm trying to create a function, not a new table.

    - mistake #1

    hardcoding data in a routine code - mistake #2

    Implementing relations between entities (title and gender) in conditional...

    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: Need Help With Conditional Logic Function

    You could do something like this:

    CREATE FUNCTION dbo.Gender

    (

    @titleofcourtesy AS VARCHAR(10)

    )

    RETURNS TABLE

    AS

    RETURN

    SELECT

    CASE

    WHEN @titleofcourtesy IN('Ms.', 'Mrs.') THEN 'Female'

    ...

    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: SEPARATE WORDS TO ROWS (Convert Comma Separated)

    Perhaps if you use it twice with a little tweak. 😉

    SELECT

    S.ID

    ,LTRIM(ISNULL(Y.Item, X.Item)) AS OUT_STRING

    FROM @SAMPLE S

    CROSS APPLY dbo.DelimitedSplit8K(S.STRING,CHAR(39)) AS X

    OUTER APPLY (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: flat file loads to stage 1 row short of expected

    I usually use this to open large flat files.

    http://www.portablefreeware.com/?id=693

    You should look at the errors to find your problem. Those will help you identify the row that's missing.

    Are you sure 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: Trying to pass a value to a variable from dynamic sql

    Quick questions:

    1. Why are you using Dynamic SQL when a normal query would be enough?

    2. Why aren't you parametrizing your Dynamic SQL leaving it open to SQL Injection?

    3. Why are...

    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: Finding the tables with no createdate

    Your code should be simpler and it shouldn't combine EXISTS and IN.

    SELECT t.name AS table_name,

    SCHEMA_NAME(schema_id) AS schema_name

    FROM sys.tables AS t

    WHERE not exists (SELECT 1

    ...

    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: Use sp_MSforeachtable to gen COUNT(*) for each table in MyDBname

    Kelley Fitz (5/4/2015)


    The ? is the table name

    EXEC MSFOREACHTABLE 'SELECT COUNT(*) AS ''?'' FROM ?'

    TABLENAME

    COUNT

    Do you realize that you posted almost the same answer one year ago...

    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: loop within in a loop of RST now working as expected

    Thank you for the feedback. I'm glad it helped.

    But please, make sure to understand what the code is doing. If you have any questions, feel free to ask.

    Also remember to...

    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: Need help

    Lowell (5/4/2015)


    your sample data didn't have any duplicates; since this seems a little homework-like, i'll give you just a couple of hints.

    duplicates are typically removed by using a GROUP BY...

    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: loop within in a loop of RST now working as expected

    The "Tally table" is simply a table with consecutive numbers. It could start at 0 or 1 or any number you need. It could even be a view, a function,...

    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: Need help with SQL Query

    Hi there! 😀

    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?

    Jeff Moden (5/1/2015)


    I had a rare and wonderful opportunity, today. Luis is in town and I finally got to meet him and have lunch with both him and Ed...

    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: Getting a stupid conversion error.

    SQLBill (4/30/2015)


    With all of these statements...

    ISNULL(NO_OF_SAMPLE_DAYS,'NO Backup Job Ran'), '',

    td = ISNULL(BackupSizeMB,'NO Data Found'), '',

    td = ISNULL(TotalDBSpaceMB,'NO Data Found'), '',

    td = ISNULL(DataGrowth,'NO Data Found'), '',

    td = ISNULL(LogGrowth,'NO Data Found'), '',

    Take...

    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: Getting a stupid conversion error.

    You're comparing a nvarchar(max) to a decimal.

    For 20%, I assume that you need 0.2

    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 - 4,966 through 4,980 (of 8,731 total)