Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. grahams

    Truncate table without logging page deletions

    Ok. Sorry if I didn't express myself properly - I understand that but I'm wondering if there's any way of not logging those page deallocations (I said deletions - my mistake)? I might just drop the table and re-script it actually.
  2. grahams

    Truncate table without logging page deletions

    Hi. I need to truncate a table that has in excess of 2.5 million rows. I have a recent backup (i.e. yesterday) but in truth I don't need the data anyway, the backup is (in this case) purely a paranoia thing. Now, I know truncating the table won't log the individual delete transactions but I...
  3. grahams

    How to recieve the SQL Syntax of a DTS Package

    No problem. By the way there is no reason why your package would be any more difficult to edit after doing a Save As VB file. It just saves a copy in VB format is all. I'm not sure what 5791 was getting at, unless they were talking about editing the package in VB itself, which would be harder...
  4. grahams

    Return Names of SQL Servers on network?

    Had a quick scant myself - you can do this too: Private Function listSQLServers() Dim oSQLServer As SQLDMO.Application oSQLServer = New SQLDMO.Application() cboServers.DataSource = oSQLServer.ListAvailableSQLServers cboServers.DataBind() End Function...
  5. grahams

    How to recieve the SQL Syntax of a DTS Package

    AHand, believe me your English is a lot better than my German :-) The only thing I know for sure you can do is to save the package as a VB .bas module. This will convert the functionality of the DTS package into VB code, and should include all the SQL statements that are run. Of course...
  6. grahams

    Return Names of SQL Servers on network?

    Possibly not the ideal forum, but here's some VB6 code for it - can't be that different: Private Sub listSQLServers() Dim oSQLServer As SQLDMO.Application Dim i As Integer Dim sRetValue As String Set oSQLServer = New SQLDMO.Application Dim List As NameList Set List =...
  7. grahams

    loop and print

    You can use a WHILE loop in SQL Server - check it out in BOL: http://msdn.microsoft.com/library/en-us/tsqlref/ts_wa-wz_6oyt.asp?frame=true Cheers, Graham
  8. grahams

    Changing the Name of MSDE 2 Installation

    Do you have a prior installation of SQL Server on your machine (maybe a SQL7 install)? What you have there is a named instance of SQL 2000, just like I have on mine, where my default install (addressable as localhost) is SQL7 and simply bears tha name of my machine. I'm not sure there's any way...
  9. grahams

    Trouble With Dates, Variables, and Update

    Ye gods, you're right. Time to go home for a lie down I think. Did I say something somewhere about my brain still working? Sheesh.....
  10. grahams

    Trouble With Dates, Variables, and Update

    Oh - I couldn't test it, but where did I go wrong? My understanding was that CptTom wanted the 15th day of the month prior to the date in dte_reported (rather than from today). Have I done anything else obviously wrong? Am I going mad/blind? ;-)
  11. grahams

    Trouble With Dates, Variables, and Update

    declare @PrevDate varchar(10) declare @PrevMonth int, @PrevYear int set @PrevMonth = dateadd(m, -1, dbo.XMF_NMC.Dte_Reported) set @PrevYear = datepart(yyyy, dbo.XMF_NMC.Dte_Reported) set @PrevDate = '15/' + convert(varchar(2), @PrevMonth) + '/' + convert(varchar(4), @PrevYear) UPDATE...
  12. grahams

    Trouble With Dates, Variables, and Update

    I suspect these are meant to be your variable names: SET @MLastDate = (Mmonth + MDate + MYear) but you've missed your @ :-) Graham
  13. grahams

    Dynamic SQL: querying sysobjects

    You're welcome. It wasn't a waste of time - and besides, in the absence of actual work from my employers, at least this place keeps my brain working :-)
  14. grahams

    Dynamic SQL: querying sysobjects

    Well, if you want to do it this way, try changing your dynamic sql so that it uses a three-part DB name thus: 'select name from ' + @DBName + '..sysobjects where name like "up%" and type = "p"' HTH, Graham
  15. grahams

    Correct format for 2000/01/01 13:12:45

    That's because your CONVERT is using 112, which is yyyymmdd - the time was never there. Try using 120, and see BOL CONVERT for the various formats.
  16. grahams

    Correct format for 2000/01/01 13:12:45

    select CONVERT(varchar, myDate, 120) as TheDate etc Is this what you meant? HTH, Graham
  17. grahams

    Stored proc question

    Can you not simply use MAX() whenever you need to know which is the highest valued? HTH, Graham
  18. grahams

    Toppercent syntax

    To select the top 10% of table 'myTable', column 'myColumn': SELECT TOP 10 PERCENT myColumn FROM myTable It seems you were after the TOP operator after all. HTH, Graham
  19. grahams

    Toppercent syntax

    Yes indeed - my apologies, this is a new one on me. Presumably since this is a function that returns a table type, you could order the results selected from it by any valid column thus: select * from TopPercent([Products], [Unit Sales], 60) order by [unit sales] (following the example given in...
  20. grahams

    Toppercent syntax

    Well, in SQL Server it's: SELECT TOP 50 PERCENT FROM myTable ORDER BY myColumn but the phrasing of your question makes me wonder whether you're using SQL Server... Do tell :-) Graham

Part and Inventory Search

Back
Top