Forum Replies Created

Viewing 15 posts - 376 through 390 (of 424 total)

  • RE: New to 2005, Looking for advice on the best way to write a query

    I have a table which contains information on approx 250 people. There are 3 columns in this table that I'm interested in (ID, LName, FName). What I'm looking to do...

  • RE: Combining sequential events in a table

    ian's first solution should be all you need with this minor change:

    select logon.hostID,

    logon.eventTime as logonTime,

    (select min(eventTime) from Events...

  • RE: Dynamic SQL into a temp table

    IF (@GreaterThan IS NOT NULL) AND (@LessThan IS NULL)

    SELECT @And = ' AND MonthToDate_Total >= ' + CONVERT(VARCHAR(20),@GreaterThan) + ' '

    ELSE IF (@LessThan IS NOT NULL) AND (@GreaterThan IS NULL)

    SELECT...

  • RE: A count of distinct rows from 2 tables

    assuming Gradstudent.loginid is a unique key, and "The question asks for how many students are not TA's? "

    select count(*) from gradstudents

    where loginid not in (select loginid from ta)

    this statement...

  • RE: Dynamic SQL into a temp table

    It seems that your need for dynamic sql can be eliminated with a bit of rework. For example, this block:

    IF (@GreaterThan IS NOT NULL) AND (@LessThan IS NULL)

    SELECT @And...

  • RE: Is this possible, select into on specified filegroup?

    i'm sure someone will correct me if i'm wrong, but i believe that select into is not logged while insert into is. if so, select into will be faster...

  • RE: Dynamic SQL into a temp table

    any temp table created in a stored procedure vanishes after the stored procedure completes. so you can't use sp_executesql to create a temp table. you'll need to create...

  • RE: Is this possible, select into on specified filegroup?

    from the 'Inserting Rows by Using SELECT INTO' topic of BOL:

    SELECT INTO does not use the partition scheme of the source table. Instead, the new table is created in...

  • RE: ADODB with NOLOCK

    the view's DDL NOLOCK will override any connection/session locking.

  • RE: IF Exists and a clause questions

    In T-SQL there is no guarantee about the order of how OR and AND statements are evaluated. Of course precedence rules are observed, and the result will also stay correct,...

  • RE: IF Exists and a clause questions

    nugroho (1/22/2008)


    Hi all,

    Second Question:

    SELECT * FROM Table1 WHERE (@S=1 AND CONTAINS(column1,'key1')) OR (@S=2 AND CONTAINS(column2,'key1')) OR (@S=3 AND CONTAINS(column3,'key1'))

    Does SQL engine will search (CONTAINS) only in 1 column depending on...

  • RE: how to combine optional result sets

    to Jeremy:

    we rolled out the combined search to testers yesterday. they liked it so much that they've asked for a 4th search method! so the technique described earlier...

  • RE: Count function with nulls in columns

    GilaMonster (1/19/2008)


    If there are nulls in the columns you're filtering on, then you have to allow for nulls so that the rows can appear in the result set.

    where (M.region=@region OR...

  • RE: how to combine optional result sets

    selecting all values is not an option since there about 36,000 items currently in 6 months of data and we expect 120K items or more in the full 5 year...

  • RE: column name change

    sql server management studio makes it easy. just open the table, its columns, and right-click the column (or click it twice).

    from the command line, use sp_rename

    EXEC sp_rename

    ...

Viewing 15 posts - 376 through 390 (of 424 total)