Forum Replies Created

Viewing 15 posts - 3,226 through 3,240 (of 8,731 total)

  • RE: Split string into multiple entries based upon known static length

    Using a tally table and SUBSTRING(), it's very easy to accomplish this. In this example, I'm using a cte to create the tally table on the fly.

    Consider changing the text...

    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 sort sql result set like attached image

    Or maybe something like this:

    ORDER BY ProjID, NULLIF(CategName, 'OWN STAFF TEAM')

    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: Can I kill DBCC Shrinkfile???

    SQL-DBA-01 (3/7/2016)


    If I stop shrink command before its completion, does it rollback everything ?

    According to Gail's last post, it won'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: Today's Random Word!

    Grumpy DBA (3/7/2016)


    whereisSQL? (3/7/2016)


    Control

    Freak

    Freakazoid!

    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 SUBSTRING and CHARINDEX

    Maybe something like this?

    CREATE TABLE #Test(

    ErrorString varchar(400)

    );

    INSERT INTO #Test VALUES('Login failed for user ''User1''. Reason: Failed to open the explicitly specified database. [CLIENT: 11.11.11.11]');

    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: Substring from RIGHT

    sharonsql2013 (3/4/2016)


    I am trying to get a substring of characters but need to go from right

    Example 9.0.0832.1032 need to get the 32 (one after 08).

    10.01.0832.1064 need to get...

    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: programming within SELECT statement

    Absolutely no variable declarations or multiple instructions. All variables should be defined before the query.

    You can have queries inside queries. These are called subqueries and are a great tool. However,...

    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 create a Stored Procedure from this Code

    oneteabag (3/4/2016)


    Nice Thoughts newbie, I got the logging part but wasn't sure if I stay away from SSIS how I would automate this process.? Right now it is just 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: programming within SELECT statement

    etl2016 (3/4/2016)


    Hi,

    Does SQL Server allow programming within a SELECT statement?

    For instance, SELECT col1, col2 (some programming result) as Col3 FROM tables

    Could you please share some thoughts.

    thank you

    What kind...

    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: The Tally Table

    Gary Varga (3/4/2016)


    Steve Jones - SSC Editor (3/4/2016)


    Gary Varga (3/4/2016)


    I have still yet to come across a requirement that would benefit from the use of a tally table. I read...

    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 unique id for each row within a range

    Jeff Moden (3/4/2016)


    bismsit.29 (3/4/2016)


    sure john i will let you know all in detail. i would look forward for your suggestion in this.

    this is a new table which will get offer...

    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 way to script out Linked server with remote login password ?

    simon.jones.p (3/4/2016)


    Hello, I know your post is a bit old so I'm working with a 'better late than never' approach to this.

    Passwords can now be extracted. Anyone who arrives...

    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: Many conditions - best practice

    SmackMule (3/3/2016)


    This is beautiful! Exactly what I wanted and so much to follow up on and learn. Thank you *very* much for the info and example. I implemented per your...

    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 many peers?

    TimCarrett (3/4/2016)


    Ok so don't use windows calculator to try to calculate this. I can now see my mistake.

    Good question, poor calculator skills.

    Hey, I used the Windows calculator. The beep indicated...

    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: Export Oracle tables (or query) for import to SQL Server

    I've managed to solve the first 3 issues using format files. The fourth issue can be solved by cleaning the data in a staging table using T-SQL (REPLACE(ColumnName, '""', '"')).

    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

Viewing 15 posts - 3,226 through 3,240 (of 8,731 total)