Forum Replies Created

Viewing 15 posts - 106 through 120 (of 443 total)

  • RE: Code generation

    Well I dont know if was a coincidence.

    I generated 1000000 rows in a tally table;

    Select Top 1000000 Identity(int,1,1) N

    into tblTally

    from sys.columns a, sys.columns b,sys.columns c

    Then, I inserted 1000000 in...

  • RE: Values <> null

    Atif Sheikh (5/9/2010)

    --------------------------------------------------------------------------------

    Set ANSI_NULLS off / on changes the results.

    By default in database settings it is set to OFF.

    But in SSMS --> Tools --> Options, go to Query Execution...

  • RE: Error

    It would be MUCH BETTER if you consult the BOL for the errors / exceptions in the code.

  • RE: Values <> null

    Set ANSI_NULLS off / on changes the results.

    By default in database settings it is set to OFF.

    But in SSMS --> Tools --> Options, go to Query Execution -->...

  • RE: Question of the Day for 22 Jun 2007

    2 and 3 are correct.

  • RE: Joins Vs Views

    Question 1. If I do create a view, can the view be indexed even if the tables are not indexed?

    Yes you can.

    Question 2. Will the indexed view be better than...

  • RE: How to update different values for a singal column

    WHEN (marks between 60 and 79) THEN 'C'

    Just one thing. Replace 79 with 78.

  • RE: How to update different values for a singal column

    Try this code....

    1. UPDATE t1

    2. SET t1.colx=t2.colx

    3. FROM t1,t2

    Didnt get the point....

  • RE: Select query of Multiple Data base, Data base name in parameter

    Dynamic SQL is the only solution that comes to my mind. Using it with sp_executesql is safe.

  • RE: script help

    Why not to use Top(N) clause with Order by Col1?

    I think it should solve the problem.

  • RE: How to count a query result?

    Something like this...

    Select NIN_CODE,Count(*) as Cnt from (

    select distinct OO.ORDER_NUMBER, OO.NIN_CODE

    from Table as OO

    WHERE (OO.SUBMITTED_DATE BETWEEN '20090101' AND '20091231')

    AND (OO.TICKET_NUMBER IS NOT NULL) and OO.NIN_CODE='990685711' or OO.NIN_CODE='993435940'

    ) Main

    group...

  • RE: Joins Vs Views

    But if you need an indexed view, then I think you should go for proper defined view instead of joining tables everytime. I think it depends upon the situation.

  • RE: Looking for a specific record number

    It depends upon the table structure that you use to store Transactions of Current Month and Last Months. As said above, plz post the sample data and structure.

    From your description...

  • RE: can any one please guide

    Try This...

    Declare @vShiftTable Table (ShiftID int, startTime datetime, endtime datetime)

    Declare @vVarTime datetime

    declare @start varchar(10)

    set @start = '06:00'

    declare @End varchar(10)

    set @End = '13:59'

    Insert into @vShiftTable

    Select 1,@start,@End

    set @start = '14:00'

    set @End =...

  • RE: Help me to write a query

    Thanks for posting that Atif.

    No Problem....:-D

Viewing 15 posts - 106 through 120 (of 443 total)