Forum Replies Created

Viewing 15 posts - 6,991 through 7,005 (of 7,608 total)

  • RE: tempdb fileplacement

    You also need to verify that the log LUNs are RAID10 and the data LUNs are RAID5 (typically that is the best performance).

    If you're going to put both tempdb mdf...

  • RE: Correlated Subquery - Stream Aggregate

    SQLSACT (12/19/2012)

    Why does the 1st query return duplicates and the 2nd query doesn't?

    ... the 2nd query having a stream aggregate. Why is this being added?

    Thanks

    The first query does a JOIN;...

  • RE: Better way to write this?

    Don't see anything magical to let you get rid of any of the lookup joins :-).

    There typically won't be, so all you can do is tune the lookups as much...

  • RE: Column to Generate a Confirmation Number

    If you do need a prefix (and/or suffix), you can do this:

    CREATE TABLE dbo.tablename (

    prefix char(3) DEFAULT 'ABC',

    ident int IDENTITY(1, 1) NOT...

  • RE: Better way to write this?

    I would still like further info on the indexes. Please post the results of this query run from that db (a subset of what I use to analyze index...

  • RE: Finding a quote in a string

    string_column LIKE '%''%'

    or:

    CHARINDEX('''', string_column) > 0

  • RE: Append query results to existing table

    Yes.

    Typically a LEFT OUTER JOIN is used for that.

    Say you're inserting names and want to avoid inserting one that's already in the table:

    INSERT INTO dbo.names_table ( name )

    SELECT wt.name

    FROM dbo.work_table...

  • RE: generating a column for each value in foreign key

    If you're 100% sure that no group_id will ever be more than one type, then that looks OK.

    You probably want to consider using an IDENTITY column to automatically assign one...

  • RE: ''=0 ?!?!

    Interesting too is that an empty string does not work for decimal values:

    SELECT 1.1+''

    But it again does work for dates:

    SELECT CAST('' as datetime)

    Ah the wonders of SQL -- "wonder why...

  • RE: SQL Server Memory - High

    44 out of 48 is definitely too high. Keep in mind that the OS needs some RAM to manage the RAM itself.

    Assuming no other software using significant RAM is...

  • RE: Change column from NVARCHAR to VARCHAR...

    PiMané (12/18/2012)


    ScottPletcher (12/17/2012)


    Since you have to ALTER columns only one at a time (why, MS, why??), I'd create a new table and INSERT every row into it, converting every column...

  • RE: Change column from NVARCHAR to VARCHAR...

    Since you have to ALTER columns only one at a time (why, MS, why??), I'd create a new table and INSERT every row into it, converting every column at one...

  • RE: IF statement with subquery problem

    sp_MSforeachdb is convenient, but it has huge overhead and is probably overkill for what you need.

    You can use sp_executesql to return a value from dynamic SQL, albeit that it's not...

  • RE: Missing Indexes on Temp tables

    TheSQLGuru (12/16/2012)


    My statement about making "queries" faster is about the ENTIRE process. The act of populating a temp table with an index already on the temp table before data...

  • RE: Grouping by time - can't figure this out!

    If I understand correctly, maybe something like below.

    [Btw, as a general performance guideline, make sure the datatype of the time in the table exactly matches your list of times. ...

Viewing 15 posts - 6,991 through 7,005 (of 7,608 total)