Forum Replies Created

Viewing 15 posts - 91 through 105 (of 314 total)

  • RE: Intersection of two date ranges.

    Bill,

    I hope this answers ur questions.

    1.Create a populate Date table.(Lookup table)

    Create table Dates(

     dt_Date datetime,

     WeekOf datetime)

    Declare @dt_Date datetime

    set @dt_Date ='2-Jan-2006'

    set DateFirst 1

    While (@dt_Date <= '2-Jan-2011')

    Begin

     Insert into Dates(dt_Date,WeekOf)

     select @dt_Date,DateAdd(d, -1 *DatePart(dw,@dt_Date)+1,@dt_Date)

     set @dt_Date =...

  • RE: URGENT HELP - Restore database

    Try connecting to server with "." as server name and see if it connects. If it does then u can change the relationship between "LOCAL" and ur actual server name.

    Thanks

    Sreejith

  • RE: loop through all records in a database

    I would like to avoid cursors as much as possible but in your case I think its better to use cursors:

     

    Set nocount on

    Declare @id varchar(50), @name varchar(50), @email varchar(255)

    Declare my_cursor...

  • RE: Intersection of two date ranges.

    Bill,

    To help us help u we need more information than what u had given. Can you give us some specific examples and what u except to see?

     

    Thanks

  • RE: More than 4 records in 60 minute period

    I hope this is what u are looking for:

    Select * from

     (

     SELECT #Period.AccountNumber,#Period.DateIn,--#Period.Amount,

     (SELECT sum(Amount) FROM #Period S

       where #Period.AccountNumber = S.AccountNumber

       and S.DateIn between #Period.DateIn and DateAdd(mi,60,#Period.DateIn)) as Amount,

     (SELECT Count(*) FROM #Period...

  • RE: how can i save time ?

    are u trying to run a query and it takes longer? Do u want to speed up the query?

  • RE: Same Position - Man makes more money

    I would say there is a lot of discrimination out there. My previous employer got me at the lowest point in my career. My company had laid off and...

  • RE: Dynamic date in a query/export

    Try this:

    Declare @dt_Date datetime,

     @dt_EndDate datetime

    set @dt_Date=getdate()

    select @dt_EndDate= Cast(Convert(Char(10),DateAdd(d,-1* Datepart(d,@dt_Date) + 1,@dt_Date),101) as datetime)

    Select DateAdd(m,-1,@dt_EndDate) as BeginDate,@dt_EndDate as EndDate

    Thanks

    Sreejith

  • RE: Transaction in SQL Job Steps

    You can add multiple "Execute SQL Tasks" and define works flows. Check it out.

    Thanks

    Sreejith

  • RE: running DTS from stored procedure

    Thanks Mattie for clarifying.

    Your problem is u(Or the Account SQL Starts) don't have permissions to access one of the files mentioned in the connection object.

    Thanks

    Sreejith

     

  • RE: two tables or one?

    what do u mean by table 1(journal_entry_tb) up to date with table 2(journal_food_entry). I don't see any column thats repeating on both the tables (except PK-FK keys). Are u trying...

  • RE: how to kill database connection-emergency

    when u stop and start SQL server all the connections would have been lost or killed. How can a tech support tell u that "Old" connection still exists.

    Try running:

    sp_who and...

  • RE: Stupid query question...

    Try this:

    Option 1: Max Page By PageID

    Select Page_History.startdate, Page_History.starttime, Page_History.page, Page_History.pageid 

     from dbo.Page_History Page_History INNER JOIN (

     Select pageid,max(startdate) as MaxStartDate ,max(StartTime) as MaxStartTime

      from dbo.Page_History pgh2

     group by pageid ) MaxPage on...

  • RE: Transaction in SQL Job Steps

    DTS can handle transactions so Can you add the jobs steps in DTS and schedule the DTS?

    Thanks

    Sreejith

  • RE: running DTS from stored procedure

    Schedule the DTS and Copy the DTSRun.....from the schedule job and paste it in after xp_cmdshell

    Thanks

    Sreejith

Viewing 15 posts - 91 through 105 (of 314 total)