Forum Replies Created

Viewing 15 posts - 346 through 360 (of 2,007 total)

  • RE: Fastest way to count total number of rows...

    Dave62 (1/31/2013)


    This is the fastest and most reliable way I have found.

    SELECT SUM (row_count)

    FROM sys.dm_db_partition_stats

    WHERE object_id = OBJECT_ID('dbo.MovimentosFuncionarios')

    AND (index_id=0 or index_id=1);

    Enjoy!

    Still an approximate row...

  • RE: Fastest way to count total number of rows...

    PiMané (1/31/2013)


    I'm trying to determine the fastest way, and as far as I tested, the sys.partitions is the fastest but just don't know how reliable the info is...

    DBCC UPDATEUSAGE is...

  • RE: Fastest way to count total number of rows...

    PiMané (1/31/2013)


    is the sys.partitions table always "reliable" as for the number of rows?

    It's reliable as an approximate count for an individual table or index. You may be able to...

  • RE: Splitting postcodes

    Abu Dina (1/31/2013)


    This I've answered my own question with this:

    select postcode, LEFT(postcode,LEN(postcode)-3) + ' ' + RIGHT(postcode,3)

    from flatrecord_SemiPerm

    where PATINDEX('[A-Z][A-Z][0-9][0-9][0-9][A-Z]%', postcode) > 0

    What country are you doing? I'm going to assume...

  • RE: VB.net error

    It has been awhile since I've done any VB.net, but don't you need a WithEvents variable?

    e.g.

    Dim WithEvents ev As New EventClass

    Sub TestEvents()

    ev.RaiseEvents()

    End Sub

    Sub ev_EventHandler() Handles ev.XEvent,...

  • RE: Employer asking for Social Media login?

    Facebook terms of service states: -

    Safety


    We do our best to keep Facebook safe, but we cannot guarantee it. We need your help to keep Facebook safe, which includes the following...

  • RE: Something random to ponder

    A friend works somewhere with a DA (Data Administrator) in addition to three DBAs (Production, Development & Backup). All four are heads of small teams. Admittedly, I've never worked anywhere...

  • RE: Assigning current date without time value to column

    Jeff Moden (1/9/2013)


    Careful now. I realize that Lynn has already pointed it out but I want to emphasize it... The example that Lynn gave is the correct...

  • RE: How to calculate tax.....

    In your description, you've not described any use for the table "taxes".

    This fulfils your description: -

    SELECT *

    FROM (SELECT co.company, co.location, co.order_no,

    CAST(co.order_qty AS INT)...

  • RE: Vertical Partitioning with transactional replication

    Did anyone get anywhere with this?

  • RE: Assigning current date without time value to column

    10e5x (1/4/2013)


    omg i am losing the discussion over here... so the recommended solution to me is which? And is it a typo or? why there are two '??' sry for...

  • RE: Assigning current date without time value to column

    Lynn Pettis (1/4/2013)


    Actually:

    DELETE FROM TABLE WHERE (CREATION_D = DATEADD(DAY, DATEDIFF(DAY, 0, ?? ), 0));

    SET NOCOUNT ON;

    DECLARE @a DATETIME;

    SET @a = GETDATE();

    --First

    SELECT DATEADD(DAY, 0, DATEDIFF(DAY, 0, @a ));

    --Second

    SELECT DATEADD(DAY, DATEDIFF(DAY, 0,...

  • RE: Assigning current date without time value to column

    10e5x (1/4/2013)


    So if i have an sql statement in my execute sql task that looks something like this:

    Delete from TABLE where (CREATION_D = ?)

    CREATION_D is the column i am discussing...

  • RE: Comparing dates from multiple rows of duplicate data

    Grinja (12/21/2012)


    Try the following:

    --Load sample data

    CREATE TABLE #Invoice (ID INT, InvoiceNumber INT, Created DATETIME)

    INSERT INTO #Invoice

    SELECT 6,125870808, '2012-12-18 15:45:30.000'

    UNION ALL

    SELECT 5,125870808, '2012-12-18 12:23:27.000'

    UNION ALL

    SELECT 4,125870808, '2012-12-18 06:45:06.000'

    UNION ALL

    SELECT 3,125870808,...

  • RE: Finding a quote in a string

    dwain.c (12/20/2012)


    vinu512 (12/20/2012)


    dwain.c (12/19/2012)


    Since quote is also CHAR(25), you can also do this:

    CHARINDEX(CHAR(25), string_column) > 0

    Single Quote is char(39) Dwain......if I am not wrong. 😉

    Looked like a single quote when...

Viewing 15 posts - 346 through 360 (of 2,007 total)