Forum Replies Created

Viewing 15 posts - 1,426 through 1,440 (of 2,452 total)

  • RE: Need Help to remove first word

    maybe something like this ??

    declare @address as varchar(300)

    set @address = 'removeme 100 1st Street Somewhere'

    select @address

    select ltrim(stuff(@address,1,charindex(' ',@address),''))

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Adding Counter to Names When IDs are the Same

    helal.mobasher 13209 (6/4/2014)


    Results:

    id NAME addresses CounterName

    1 john doe 50 north john doe-001

    1 john doe ...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: SQL query where value is less than negative number not giving expected results

    currency format, with symbol and commas, right aligned (output to text or file)

    messy 😀

    USE tempdb;

    GO

    DECLARE @testtable TABLE (

    [AccountNo] VARCHAR(12) NOT NULL

    , [IVTotal] DECIMAL(18, 5) NOT NULL

    , [GLTotal] DECIMAL(18,...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Query question, does this result in a "Cartesian join?"

    Koen Verbeeck (6/2/2014)


    Lynn Pettis (6/2/2014)


    Looks like a Cartesian product to me as well.

    Looks like someone was writing the query using the ANSI-89 joins but forgot the WHERE clause to properly...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Update Query Help

    wild guess....OP please provide expected results based on your sample data.....thanks

    ;with cte_tab as (

    SELECT weekdate

    , Aid

    , Cid

    , row_number() OVER (PARTITION BY AID ORDER BY weekdate DESC) rn

    FROM Tab1

    )

    SELECT weekdate

    , Aid

    ,...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: List current and previous year dept - Query help

    lsalih (6/1/2014)


    Sorry for the late reply, I got busy with other things... Attached is a test file which includes a sample script. The goal is to list person information such...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Select is fast, but Insert is Slow

    AndrewSQLDBA (5/30/2014)


    What about inserting all the rows into the ETL table that I have already verified, and then delete the rows from the ETL table that are already in the...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Select is fast, but Insert is Slow

    AndrewSQLDBA (5/30/2014)


    I know this is a little tough with not seeing anything.

    Andrew...Happy Friday 🙂

    any reason why you cant provide more details?

    regards

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Code samples in the forums

    click on the shortcut in the box on the left of the message pane

    paste code between the two code blocks

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: List current and previous year dept - Query help

    maybe be easier for us to give you a tried and tested answer if you can please provide set up scripts for create table / insert sample data and the...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: too many arguments - but they match

    danaanderson (5/25/2014)


    J Livingston SQL (5/25/2014)


    danaanderson (5/25/2014)


    Anyone else have any thoughts? It's surprising that there was only one person replying in a time span of about 23 hours.

    not sure what...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Recursive CTE? Not Sure How To Do This...

    Hi auto....code without the SalesRepId.......based on previous code provided....still using the temp table.

    IF OBJECT_ID('#tempsales') IS NOT NULL DROP TABLE #tempsales

    SELECT CustID

    , SalesRepID

    , SaleDate

    , eligibility

    INTO #tempsales

    FROM Sales

    CREATE CLUSTERED INDEX cix_jls ON...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: too many arguments - but they match

    danaanderson (5/25/2014)


    Anyone else have any thoughts? It's surprising that there was only one person replying in a time span of about 23 hours.

    not sure what you expect from a...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Recursive CTE? Not Sure How To Do This...

    autoexcrement (5/24/2014)


    Also, for whatever reason, I wasn't able to get it all working with the 3-part assignment syntax. Maybe my fault. But it's all working great with the more verbose...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Are the posted questions getting worse?

    Jo Pattyn (5/24/2014)


    Welkom back wolfkillj, could you fix the link to your blog? It points to the thread.

    http://sqlsouth.wordpress.com/2014/05/23/export-xml-from-sql-server-using-bcp/

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

Viewing 15 posts - 1,426 through 1,440 (of 2,452 total)