Forum Replies Created

Viewing 15 posts - 271 through 285 (of 363 total)

  • RE: Result of dynamic query in variable

    would something like this help?...

     
    
    select * from OpenRowset('SQLOLEDB',
    'Server=(local);Trusted_Connection=yes',
    'Exec Master.dbo.sp_who')

    You can do this within a UDF.

    Two Problems:

    1. Not...



    Once you understand the BITs, all the pieces come together

  • RE: Off topic.........

    I Second That

    It's been great fun participating in these forums since I started a couple of months ago.

    I believe this is...



    Once you understand the BITs, all the pieces come together

  • RE: Simplifying this select

    Matt, I apologize again for the errors .

    Thanks for your patience.

    I hope I at least provided some things to help you and maybe others.

    Vacation...



    Once you understand the BITs, all the pieces come together

  • RE: Simplifying this select

    It's getting close to vacation time 🙂 so my typing is getting rough :(.... last post I had "is" misplelled as "id". Please correct... It's hard to test some of...



    Once you understand the BITs, all the pieces come together

  • RE: Simplifying this select

    Let's try again...

     
    
    -- Make #EOMDates table
    If Object_ID('TempDB..#EOMDates') id Not NULL Drop Table #EOMDates
    Select * Into #EOMDates From
    (
    Select Convert(DateTime,...



    Once you understand the BITs, all the pieces come together

  • RE: Simplifying this select

    Sorry Matt, I had the WHERE above the JOIN in my initial post... anyway, let's splitup the complexity...

     
    
    -- Make EOMDates table
    If...



    Once you understand the BITs, all the pieces come together

  • RE: Simplifying this select

    Matt, 1st thing I see is you have "WHERE" twice in one WHERE CLAUSE....

    "where on_contract <="

    should be

    "and on_contract <="

    As far a formatting the post,...



    Once you understand the BITs, all the pieces come together

  • RE: question about a system query

    Sorry,

    you need to change

    SELECT CAST(C.NAME AS VARCHAR(30))

    to

    SELECT CAST(C.NAME AS VARCHAR(30)) as Colx



    Once you understand the BITs, all the pieces come together

  • RE: question about a system query

    How long does it take to run...

     
    
    Select Count(*) From (
    SELECT CAST(C.NAME AS VARCHAR(30))
    FROM AUT103_DATA.DBO.SYSOBJECTS O,AUT103_DATA.DBO.SYSCOLUMNS C
    where o.xtype = 'U' and...



    Once you understand the BITs, all the pieces come together

  • RE: variable for DB name in sql script

    How about

     
    
    Declare @otherDB VarChar(50), @SQL varchar(8000)
    set @otherDB = 'Pubs'

    Set @SQL = 'Print db_name(db_id())'

    Set @SQL = @otherDB + '.dbo.sp_ExecuteSQL...



    Once you understand the BITs, all the pieces come together

  • RE: Simplifying this select

     
    
    Select DatePart(m, EndOfMonthDate) as the_month,
    DatePart(yyyy, EndOfMonthDate) as the_year,
    isnull( (SELECT SUM(num_units) from active_units_static where month_end = EndOfMonthDate), 0)
    + count(termnum) as active_units ...



    Once you understand the BITs, all the pieces come together

  • RE: Help with dates

    I do not know your context, but try...

     
    
    Declare @Test DateTime
    SET DATEFORMAT dmy
    Select @Test = '31/12/03'
    Print Convert(VarChar(25), @Test)
    SET DATEFORMAT...



    Once you understand the BITs, all the pieces come together

  • RE: DateTime parmater for sp and debug

    I'm glad you got something to work. Let us know if you find out how to pass dates in the debugger.



    Once you understand the BITs, all the pieces come together

  • RE: information_schema.tables

    To investigate the above, I took a look at the definitions of both the information_schema.tables VIEW, and the sp_tables SP in the Master db. This helps me understand the parameters...



    Once you understand the BITs, all the pieces come together

  • RE: How to test DOS "file in use" status?

    Did it, works! Thanks.

    Called the function a couple of thousand times in a about a 12 sec loop just to test... got -2146828235 result until file existed, then result...



    Once you understand the BITs, all the pieces come together

Viewing 15 posts - 271 through 285 (of 363 total)