Forum Replies Created

Viewing 15 posts - 601 through 615 (of 2,894 total)

  • RE: Insert Performance

    Sergiy (3/13/2013)


    Actually, building such a query for a million rows will produce about a GB of a script.

    It will take ages lust to parse it.

    For million rows uploads there are...

  • RE: How SQL query result insert in to table?

    Minnu (3/13/2013)


    Hi Team,

    Daily am taking the size of databases using "EXEC SP_Databases" and updating in a excel file manually,

    DATABASE_NAME|DATABASE_SIZE|REMARKS

    now i want to create a job to execute the above query...

  • RE: How do I optimize a query with a text column?

    Hawkeye_DBA (3/12/2013)


    Thanks,

    yes, without the column it uses the index.

    The execution time is 1m 24s

    So, just taking Text column out of your table takes 1 m 24 seconds?

    What...

  • RE: Insert Performance

    Sergiy (3/12/2013)


    Single INSERT INTO with UNION ALL in SELECTs will be waaaay faster.

    UNION ALL million rows? I don't think so!

    What is the source? Where data coming from?

    BTW. Million separate...

  • RE: How do I optimize a query with a text column?

    So you are saying that if you remove text column from query you have index seek?

    so the following query should use index seek then:

    SELECT

    COLMAIN_ID, COL1, COL2, COL3, COL4,

    COL5,...

  • RE: How do I optimize a query with a text column?

    Hawkeye_DBA (3/12/2013)


    My query is structured like this:

    SELECT

    COLMAIN_ID, COL1, COL2, COL3, COL4,

    COL5, COL6, COL7, COL8, COL9,

    COLText_10, COL11, COL12, COL13, COL14,

    COL15, COL16, COL17_PK, COL18, COL19,...

  • RE: How do I optimize a query with a text column?

    Hawkeye_DBA (3/12/2013)


    Thanks for your reply 🙂

    And, you're right, making it a full-text index is irrelevant for this query.

    I can't change the data type unfortunately, other ideas are welcome!

    Thanks again

    Again, you...

  • RE: Complex SQL QUERY with DateDIFF

    fixed in my post...

    just replace

    DATEDIFF(second,@LastFlaggedLogTime, Logtime) >= 2

    with

    DATEDIFF(millisecond,@LastFlaggedLogTime, Logtime) >= 2000

  • RE: inserting data from one table to another and want to create primary key at same time

    ... Similarly you can make a NOT NULL column NULL-able by wrapping it with NULLIF.

    ... or CASE WHEN where relevant.

  • RE: Complex SQL QUERY with DateDIFF

    Don't use cursors!

    You can do it with quirky update method:

    CREATE TABLE #TEMP (LogIndex int, UserID nvarchar (10), LogTime datetime)

    insert into #TEMP select 1, '01551', '20/02/2013 17:41:45.000' --ok

    insert...

  • RE: How do I optimize a query with a text column?

    What exact SELECT query you want to optimize?

    Are you doing text search? If not, then creating full text index is irrelevant.

    Why do not change your TEXT column to VARCHAR(MAX)...

  • RE: Split a String

    Let me one guess (just a specualtion). Do you want values split to columns? If so, just use the udf like that:

    SELECT *

    INTO #test

    FROM...

  • RE: Split a String

    AndrewSQLDBA (3/12/2013)


    I was actually looking for something else. That really did not help.

    Andrew SQLDBA

    Ok, then could you please provide a bit more details about what you have and expected you...

  • RE: Index confusion

    If exists(select 1 from table where....) or even select top 1 col1 from table where....

    "EXISTS" will be faster anyway, regardless what you really select inside of it, as this bit...

  • RE: inserting data from one table to another and want to create primary key at same time

    Jeff Moden (3/12/2013)


    .... If you run your code in 2005, here's the result you get.

    Column_name Type Computed Length Prec Scale Nullable TrimTrailingBlanks FixedLenNullInSource Collation

    ----------- ---- -------- ------ -----...

Viewing 15 posts - 601 through 615 (of 2,894 total)