Forum Replies Created

Viewing 15 posts - 6,796 through 6,810 (of 15,381 total)

  • RE: Quickest and most efficient ways to handle data

    rockstar283 (9/17/2013)


    Thanks for the guidance mate..I had an interview today and the interviewer asked me the same questions..I answered it the best I could and suggested everything from count(*),@@rowcount,ranking functions...

  • RE: Finding values with only one occurrence

    You have to remember that we can't see what you see. We need something to work with. I provided this as an example.

    create table #Something

    (

    QM varchar(25),

    GD bigint,

    Geometry char(5),

    QM_OLD varchar(25),

    GD_OLD bigint,

    GEOMETRY_OLD...

  • RE: Finding values with only one occurrence

    In order to help we will need a few things:

    1. Sample DDL in the form of CREATE TABLE statements

    2. Sample data in the form of INSERT INTO statements

    3. Expected results...

  • RE: finding value in a string

    timscronin (9/17/2013)


    I have a text value in a string which I can convert to varchar(1000). field I am going to convert look like this.

    I need to extract the...

  • RE: Quickest and most efficient ways to handle data

    rockstar283 (9/17/2013)


    Hey everyone..I would like to start a discussion to understand what are the different quickest and most efficient ways to handle the following scenarios:

    1) How to move trillion records

    a)...

  • RE: Case Statement

    sharonsql2013 (9/17/2013)


    I am looking to get a one Prodcode ,Prod Description Instead of multiple (if any) for a combination of prodId , prodmonth, prodyear.

    So, it should return

    ProdIdProdMonthProdYearProdVolumeProdCodeProdDesc

    1 ...

  • RE: Finding values with only one occurrence

    Use a GROUP BY and HAVING.

    Since there is nothing to work this is only psuedocode.

    GROUP BY QM, GD, Geometry, QM_OLD, GEOMETRY_OLD

    HAVING count(Distinct GD_OLD) = 1

  • RE: converting nvarchar to decimal

    You could streamline that a little and drop the case expression if you wanted to.

    select cast(nullif(columnname, '') as decimal(18, 2))

    from #temp

  • RE: Select Records after an underscore

    Please post consumable data when posting. It makes this a lot easier.

    Here are a couple of ways you can accomplish this:

    with myData (SomeValue) as

    (

    select 'doe,john_ABCDEFG1' union all

    select 'jones,mark_L9905555'

    )

    select *,

    PARSENAME(replace(SomeValue,...

  • RE: Removing cursor rom report procedure

    PSB (9/17/2013)


    IS here any way hat I can get rid of the cursor from the procedure given below ?

    Yes.

    In order to help we will need a few things:

    1. Sample...

  • RE: converting nvarchar to decimal

    There is no such thing as an empty decimal. The reason you are seeing '' being converted to 0.00 is because when you round an empty string it will implicitly...

  • RE: Import Text File to SQL Database

    db2mo (9/17/2013)


    That worked! Now this is probably a silly question, but how do I get it to use the date that's already in the date field? By using...

  • RE: Help On Query

    When something is really urgent it would benefit you to provide more details. Doing this quickly is going to depend on your meaning of quickly. Certainly using a while loop...

  • RE: Getting Transaction ID

    andrew.whettam (9/17/2013)


    I know it's a bit late (the thread was opened in 2008!), but here is the answer:

    SELECT transaction_id FROM sys.dm_tran_current_transaction;

    This is in the sql 2000 forum. That dmv was...

  • RE: Update Table - By Looping Through Field Name

    C Hrushi (9/17/2013)


    This might hep for n number of columns :

    *********************************************************************************************

    DECLARE @Q NVARCHAR(4000),

    @CName VARCHAR(255)

    DECLARE ColCur CURSOR

    FOR

    SELECT C.name as Column_name

    FROMsys.columns C

    LEFT JOIN sys.tables t

    on C.object_id = t.object_id

    WHEREt.name = 'Your_table'

    OPEN...

Viewing 15 posts - 6,796 through 6,810 (of 15,381 total)