Forum Replies Created

Viewing 15 posts - 5,971 through 5,985 (of 6,036 total)

  • RE: not using index

    Foreign key is just constraint, not an index.

     

  • RE: not using index

    Oh, you did not?

    That's deinetely it!

  • RE: can I take rows of data to split between two tables

    Don't forget about OPENQUERY. It will help you access XLS sheets as normal tables or views without downloading it into temp tables.

    Don't forget to add $ in the end...

  • RE: Dynamic SQL help.

    Your "Use ..." is out of scope. It works only within script you run via EXEC.

    As soon as it's finished you are back to your original environment.

    Add call for SP...

  • RE: Empty Dates into SQL

    Yes, there is, they name it "NULL".

  • RE: Reindexing all tables ... am I missing something (likely ...)

    Use this:

    DECLARE @TName sysname, @IndId int, @Query varchar(4000)

    DECLARE index_cursor CURSOR

       FOR SELECT sysobjects.name, sysindexes.indid FROM sysobjects

     Inner join sysindexes on sysobjects.id = sysindexes.id

    where OBJECTPROPERTY(sysobjects.id, N'IsUserTable') = 1

     and sysindexes.indid between 1 and 250

    order...

  • RE: Select next 100 rows

    SELECT C.*

    FROM dbo.Customer c

    INNER JOIN (SELECT c2.CustID, (SELECT COUNT(*)

                                   FROM dbo.Customer C1

                                  WHERE C1.CustID <=C2.CustID) as Row_Numb

               FROM dbo.Customer c2 ) C0 on C0.CustID =C.CustID

    WHERE Row_Numb between 

    August 30, 2005 at 4:21 pm

    #586314

  • RE: How can I execute a query stored in a text field

    CREATE PROCEDURE dbo.MyProc @Script ntext

    AS

    ......

    GO

     

    EXEC dbo.MyProc ''

    and assign your SQL string to @Script inside SP.

     

  • RE: Grouping problem - or is this possible at all?

    And "E4.EmpId <=E.EmpId" is priority for employees to be returned.

    If you want another criteria choose another unique key for employees - join date, duration period on the job, etc.

  • RE: Grouping problem - or is this possible at all?

    Try this:

    SELECT *

    FROM (select E1.EmpId, E1.EmpName, E2.ReportTo from Employee E1

       inner join Employee E2 on E1.ReportTo = E2.EmpID

      where E2.ReportTo IS NULL) TL

    INNER JOIN Employee E on E.ReportTo = TL.EmpId

    WHERE (SELECT COUNT(EmpId)

      From...

  • RE: Create a view from a view

    Indexed view is a table, in fact.

    When you select data from indexed view you don't run the query because data is already prepared for selecting.

    Query is being run every time...

  • RE: Create a view from a view

    View is just a piece of code for retrieving data.

    This code is compiled first time it's being used and is stored in database compiled until you change it.

    Using view is...

  • RE: Calculated Member

    First and dummiest: single quote instead of double quote.

  • RE: Bug in Enterprise Manager

    When you press "Restore DB" EM runs set of queries searching for physical devises, last backups, etc.

    8 queries in total.

    Run profiler and find out which query causes your error.

    Probably it's...

  • RE: Sum and Group by

    0,1,2 -> /3 = 0

    If you need to group weeks 1,2,3 then you need to substract 1 from those values.

    If you need to group 2,3,4 then substract 2.

Viewing 15 posts - 5,971 through 5,985 (of 6,036 total)