Forum Replies Created

Viewing 15 posts - 31 through 45 (of 119 total)

  • RE: what is *=?

    That is what I thought it was.

    Thanks!

    Billy

  • RE: Two field DISTINCT combination

    You may want to consider using the GROUP BY clause in your SELECT statement.  GROUP BY will group the data in groups as desired.  Look up the GROUP BY clause...

  • RE: An invalid datetime value was encountered

    Actually I haven't tried that.  I will give it a shot.

    Many thanks

    Billy

  • RE: Index not showing up in Execution plan

    Is the index sorted?

  • RE: Error when indexing a view

    try...

    create view TestView1 with schemabinding as

    select TTid from dbo.TestTable1

    in the code you posted, it appears that you are aliasing TestTable1 as the alias name "schemabinding"

    HTH

    Biilly

  • RE: An invalid datetime value was encountered

    The data is fine.  There is only one datetime field in the table and that is the created date field.  I have no idea what else is there except unproven...

  • RE: An invalid datetime value was encountered

    No datetime conversions..

    here is the code...

     

    CREATE FUNCTION udf_show_this (@tblOrder_ID INT) RETURNS VARCHAR(8000) AS

    BEGIN

       DECLARE @strMsg VARCHAR(8000)

       DECLARE @i TINYINT

       SET @i = 0

       SELECT @strMsg = 'x' + CAST(@tblOrder_ID AS...

  • RE: ALTER do not work on temporary table

    You should be able to add cols to temp tables. Try this... put in batch separates between your statements.... like below:

    SELECT MSG INTO #TMPTBL FROM DBO.ORIGINALTABLE WHERE 1=0

    go

    ALTER TABLE...

  • RE: T-SQL "select 1+1 as two, two+1 as three" ?

    as far as I know, I don't think you can use column aliasing within an expression.

    how about:

    select (1+1) as two, ((1+1)+1) as three

    HTH

    Billy

  • RE: SQL Help - most popular product

    quote:


    One reason I like poking around here regularly.

    WITH TIES, didn't know about that one.

    Except we're corporate casual, so we don't wear ties.

    BOOO...

  • RE: SQL Help - most popular product

    Thanks Steve. Both our queries execute with same query cost. The only difference is that your query has much better readility.

    Billy

  • RE: RETURNING TOP X RECORDS

    How does WITH TIES know what is a tie? The SELECT statements below return the same results regardless if you use WITH TIES or not.

    DECLARE @TTT TABLE (THE_ID INT...

  • RE: UNION Statement

    Yes. According to Books-On-Line (BOL)

    <quote>

    Two basic rules for combining the result sets of two queries with UNION are:

    1) The number and the order of the columns must...

  • RE: help with stored procedure

    lenardd

    If you are still looking for a way of doing optional filters, what do you think of piecing the sql statement together in your stored procedure? this method will...

  • RE: help with stored procedure

    To follow up on my last post, if you have a date criteria which you want as optional, then it is best to piece the sql statement together and then...

Viewing 15 posts - 31 through 45 (of 119 total)