Forum Replies Created

Viewing 15 posts - 2,086 through 2,100 (of 6,036 total)

  • RE: Insert Performance

    Year, hard to argue.

    Except, probably, for this one:

    Grant Fritchey (3/13/2013)


    But, if you have to do individual inserts (and I'd be curious why), then small sets of transactions, say 10,000 at...

  • RE: Insert Performance

    From how it looks - it's about scripting DB deployment as a part of an installation package.

    That's how common tools build those scripts.

    Not sure what kind of million-rows table could...

  • RE: Insert Performance

    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 BULK...

  • RE: Advanced String Manipulation

    That big CASE statement also can be replaced with a simple function call:

    REPLACE(STR(Amount, 10), ' ', '0')

    You always welcome!

    🙂

  • RE: Insert Performance

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

  • RE: Find month totals between date columns

    This version returns 5 for Nivember 2012:

    /*Initial variables defining the range of dates to return*/

    DECLARE @ReportedMonths int, @StartMonth datetime

    SET @StartMonth = '20120101'

    SET @ReportedMonths = 15

    SELECT CalendarMonth, COUNT(TD.OpenDate) OpenIems

    /*LEFT...

  • RE: Find month totals between date columns

    Sean Lange (3/12/2013)


    Sergiy I don't think yours is returning the correct information. The OP wants the count of rows that are open during the month. For example look at November...

  • RE: interesting query

    What about grp 1?

    Do you want to return entries for grp 1 in records 16, 17 and 18 as well as 1 and 2?

    If not - can you specify formal...

  • RE: How to create a query which kill CPU?

    Create an endless loop.

    Something like this:

    SELECT *

    INTO #columns

    FROM sys.columns AS C

    DECLARE @RCNT int

    SET @RCNT = 0

    SET NOCOUNT ON;

    WHILE @RCNT = 0

    BEGIN

    UPDATE #columns

    SET column_id = 0

    WHERE ISNUMERIC(CONVERT(float,...

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

    Silly idea, I recon, but would not hurt to try:

    SELECT DT.*, T.COLText_10

    FROM (

    SELECT

    COLMAIN_ID, COL1, COL2, COL3, COL4,

    COL5, COL6, COL7, COL8, COL9,

    COL11, COL12, COL13, COL14,

    COL15, COL16,...

  • RE: Advanced String Manipulation

    Should not be so difficult too.

    Start with taking all parts of the string:

    SELECT VALUE, SUBSTRING(Value, 1,1) Prefix,

    SUBSTRING(Value, 2,12) Part1_Amount,

    SUBSTRING(Value, 13,20) Part2_WhateverItIs,

    SUBSTRING(Value, 33,LEN(Value) -33-18) Part3_Username,

    SUBSTRING(Value, LEN(Value) -19,...

  • RE: Advanced String Manipulation

    Pretty easy, actually.

    First you need to extract the actual data from the file rows:

    SELECT SUBSTRING(Value, 2,12) Amount, right(Value, 6) UserID

    FROM #StrungOut

    Then you need to convert the extracted strings...

  • RE: Sharepoint SQL Server

    Configuration storage and IOPS

    ....

    Transaction logs for the Configuration database can be large, therefore we recommend that you change the recovery model for the database from full to simple.

    School project?

  • RE: Find month totals between date columns

    /*Initial variables defining the range of dates to return*/

    DECLARE @ReportedMonths int, @StartMonth datetime

    SET @StartMonth = '20120101'

    SET @ReportedMonths = 15

    SELECT CalendarMonth, ISNULL(Report.OpenedItems, 0)

    /*LEFT JOIN allows to return every month...

  • RE: software adds comp_companyid that distors my sql results

    You may try to use WITH ROLLUP option in your query.

    It won't remove all the rows with CompanyID's from the final recordset, but will add 2 records to it"

    YEAR ...

Viewing 15 posts - 2,086 through 2,100 (of 6,036 total)