Forum Replies Created

Viewing 15 posts - 2,626 through 2,640 (of 8,731 total)

  • RE: Convert snippet from VBA to SQL

    itortu (6/22/2016)


    Thank you Luis C.

    You're welcome.

    Do you understand that this is not the best use of a stored procedure? Stored procedures (as any database code) is meant to work with...

    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: Maintaining Latin characters in SQL BULK INSERT with Format File

    Have you tried this options?

    ,CODEPAGE = 'RAW'

    ,DATAFILETYPE ...

    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?

    Brandie Tarvin (6/22/2016)


    jasona.work (6/22/2016)


    So, anyone want to start up a discussion like this closer to the US November elections?

    [Commentary deleted by me]

    I decided I was getting a little too vitriolic...

    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: Maintaining Latin characters in SQL BULK INSERT with Format File

    You're missing your row delimiter in the last row from your format file.

    16 SQLCHAR ...

    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 Eliminate or flag duplicate records

    Here's a way.

    Uncomment your preferred line.

    WITH CTE AS(

    SELECT *, ROW_NUMBER() OVER( PARTITION BY AccountID, Name, Region ORDER BY Special_Flag DESC) rn

    FROM MyTable

    )

    --DELETE...

    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 snippet from VBA to SQL

    It's not returning anything because you're telling to return nothing. Your string has a length of 13 chars, if you remove the period, it will only have 12 chars. You're...

    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 snippet from VBA to SQL

    Basically, you just change InStr for CHARINDEX(). The following code simplifies the validation, the FROM is just used to generate sample data.

    SELECT LEFT(PID, CHARINDEX('.', PID + '.') - 1)

    FROM (VALUES('123.21'),...

    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: Scalar Function - Format Numbers

    As mentioned, no need for scalar functions as they perform really bad in queries. A CASE statement will work just fine and it's not really lengthy.

    SELECT CASE WHEN LEN(phone) >...

    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: Gaps and Islands with previous possible values

    You could use the Quirky Update. Be sure to read and understand the following article as you might get this wrong if you don't know what you're doing. http://www.sqlservercentral.com/articles/T-SQL/68467/

    After 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: How to perform multiple STUFF

    Here are 2 options that might help you depending on your data.

    SELECT *,

    PARSENAME( REPLACE(JobNum, '-', '.'), 3) + '-'

    + REPLICATE(...

    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 perform multiple STUFF

    You have strings larger than the length of your column. Is that correct?

    Even after formatting, you have different lengths on each section. Do you have a predefined length or 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: is there any over head of begin try cahce ?

    rajemessage 14195 (6/22/2016)


    thank u , but my query was , will try cache block any thing?

    yours sincerley

    TRY...CATCH... won't block. Locks can block and locks are issued by SELECTs, DML 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: Today's Random Word!

    Revenant (6/22/2016)


    ThomasRushton (6/22/2016)


    Manic Star (6/22/2016)


    Ed Wagner (6/22/2016)


    Grumpy DBA (6/22/2016)


    Ed Wagner (6/22/2016)


    Performance

    Review

    Rate

    Raise

    Drawbridge

    Castle

    Palace

    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 get this lay out by GROUPING?

    You just need to define the groups in your tablix. Identify which columns define a group and use them to get what you need. Your query should show the same...

    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: A SQL Server Date Handling Issue

    Douglas Osborne-229812 (6/21/2016)


    Wouldn't that work in 2400 - not 4000? Divisible by 4 but not 400?

    No, that would become '29-feb-2' which translates as '2002-02-29'.

    Only 22 dates will successfully convert 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

Viewing 15 posts - 2,626 through 2,640 (of 8,731 total)