Forum Replies Created

Viewing 15 posts - 166 through 180 (of 1,048 total)

  • RE: Group By with Union

    Also, be careful while giving alias to a column.

    You have put alias to a column as '# of C's' which is also not correct.

    It should be like this '# of...

  • RE: Group By with Union

    R u getting any error?

    the code you have posted in not corrrect. It should be like this:

    Select *

    from

    (

    select [MS], sum ([Vis]) as 'TV',

    sum(Round([VIS]*[GR],1)) as '# of C''s'

    from [dbo].[Table1]

    group by...

  • RE: Need to run few sql scripts and store the results in a CSV file

    Use SSIS for this... It will be easy 🙂

  • RE: Help in Dynamic query....

    When I use only this-

    EXE sp_executesql @sql

    it works 🙂

  • RE: making records unique

    mick burden (9/12/2013)


    If I make a new table with the same structure, is there a way I could copy table1 into the new table using select into but substituting NULL...

  • RE: making records unique

    Its not a good idea to include all fields in a primary key as it will affect the performance....

    Did you try DISTINCT to see how many records you are getting...

  • RE: Bit by bit

    Dave62 (1/28/2010)


    A little more information about the BIT type. The bit type has 3 states: NULL, 0, and 1.

    When first declared and unset a NULL will be returned.

    Only a...

  • RE: T-SQL

    Recently before attempting the question I read in TSQL fncdamental book that when query filters like WHERE, Having etc used then IN,BETWEEN, LIKE specified as Predicates....

    I got correct answer and...

  • RE: Reset Identity Column only on 1 Times when Month have changed

    I don't think its a good idea to reset Identity column every month..rather then that you can truncate the table every month so that Identity gets reseed atuomatically....

  • RE: Comparing a to a substring

    ChrisM@Work (9/12/2013)


    The CTE is nothing more than a macro, it will be substituted into the query and result in LEFT() in the join. There's no gain.

    Okay..

    Thanks for the suggestion Chris...

  • RE: Comparing a to a substring

    What difference will the CTE make, Kapil?

    The query should be

    SELECT *

    FROM Table A

    INNER JOIN Table B

    ON LEFT(A.UserName, 7) = B.ID

    I was jjust trying to eliminate the LEFT from...

  • RE: Behavior of trigger

    Good basic question and discussion 🙂

  • RE: Getting duplicate values evenif used distinct

    AS Sean said DISTINCT doesn't means that if you get distinct values in some columns then it will be distinct for the rows...

    can you please provide a sample result set...

  • RE: Query Help

    Please provide the DDL scripts for the table creation, ddl script to insert some dummy data and desired output...

    Please follow the link in my signature and you will find answers...

  • RE: Only functions and some extended stored procedures can be executed from within a function.

    Can you please provide the whole actual code of that fucntion...

Viewing 15 posts - 166 through 180 (of 1,048 total)