Forum Replies Created

Viewing 15 posts - 271 through 285 (of 362 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...

  • 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...

  • 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...

  • 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...

  • 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,...
  • 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...
  • 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,...

  • 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

  • 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...
  • 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...
  • 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 ...
  • 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...
  • 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.

  • 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...

  • 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...

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