Forum Replies Created

Viewing 15 posts - 331 through 345 (of 1,347 total)

  • RE: ''''SMITH'''' does NOT equal ''''SMITH ''''

    It's due to ANSI SQL standards.

    Does this help:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;316626

    You can work around it using LIKE:

    SELECT * from TAB_A WHERE COL_1 LIKE 'SMITH'

    SELECT * from TAB_A WHERE COL_1 LIKE 'SMITH     ' ...

  • RE: Tricky SELECT problem with WHERE and HAVING

    SELECT o.name, c.date, count(*) 

    FROM tbl_objects As o

    INNER JOIN tbl_commands As c

      ON (o.id = c.objectId)

    WHERE EXISTS (

      SELECT 1

      FROM tbl_commands As c2

      WHERE o.Name = 'name1'

      AND   o.id =...

  • RE: Unique IO Colum in a view

    You could include the NewID() function in the resultset to add a GUID column or if using SQL 2005, use the new ranking functions to add the equivalent of a...

  • RE: Database Naming - Development / QA / Production

    How do you migrate SQL code from DEV->QA->PROD if the code is using 3-part naming of database objects ?

    Say a stored proc is referencing a table like this:

    SELECT Column FROM...

  • RE: Views VS. Tables

    A view on every table is useful for establishing the interface between a client side application and the database and isolating the client application from physical database changes.

    If you have...

  • RE: Index access on multi-join

    Not enough info to know for sure. There are too many factors, relative sizes of the tables, availability of a clustered index, fragmentation, selectivity of any indexes, data distribution, datatypes...

  • RE: move & rename file from SP

    >>still am geting error at ' + '

    -- Execute "Dir *.txt"

    exec master..xp_cmdshell 'Dir' + '*.txt'

    Server: Msg 170, Level 15, State 1, Line 2

    Line 2: Incorrect syntax near...

  • RE: Accessing large tables

    >>but not on the item_no

    You'll have to increase the timeout, then. With no index on item_no, you're looking at a 500 million row tablescan which will take a considerable amount...

  • RE: Accessing large tables

    The issue is likely not the network speed, it's the size of the table and the potential query plan required.

    Is there an index on the table with column [item_no] as...

  • RE: @filename1 is not a parameter for procedure sp_attach_db??? what?

    @filenamel ='F:\mssql\data\db1\db1_01_data.MDF',

    Look very carefully. The lowercase letter L is very similar to the number 1 ...

    @filename1 ='F:\mssql\data\db1\db1_01_data.MDF',

  • RE: Insert - Null issues

    >>The column is all null and I'm trying to make it 0,

    So all 500 rows contain a NULL in this column ? And you're converting the NULL to zero ?...

  • RE: Efficiency of IN vs. other ways to filter rows

    *shrug*

    Using the Pubs database on SQL2K, all 3 of these have an identical query plan:

    select *

    from authors as a1

    where exists (select * from authors as a2

                  where...

  • RE: Efficiency of IN vs. other ways to filter rows

    >> When doing a subquery in an Exists clause, use Select 1 instead of Select * or Select FieldName. This is faster as SQL Server recognizes that it doesn't need...

  • RE: Stopping Transaction Log Records

    -- Perform 500K updates at a time. Adjust as necessary

    Set RowCount 500000

    Select GetDate() -- Seed @@RowCount

    While @@RowCount > 0

    Begin

      -- Update rows that haven't yet been updated

      Update O

      Set No_Charge_Flag...

  • RE: Using CASE with Update

    >>UPDATE dbo..tbl1.stu

    What is "dbo..tbl1.stu" ?

    The UPDATE statement requires the name of a table, or a table alias. In 3 part naming that would be DBName.dbo.TableName.

    Then you need something to join...

Viewing 15 posts - 331 through 345 (of 1,347 total)