Forum Replies Created

Viewing 15 posts - 16 through 30 (of 30 total)

  • RE: Counting lines of code in all SPs in Database

    sqldmo example. i got some kind of null error. probably pretty easy to fix, but i just tossed some error resume statements in there

     

     

    strServer = inputbox("enter server name")

    strDatabase = inputbox("enter...

  • RE: PUSHD/POPD and Temporary Drive Letters

    you simply need to put the popd command in there.

     

    if you wanted to do something like... get the current drive mapping (the one that was mapped by pushd) ,...

  • RE: How to programatically determine all DB Drive usage

    'display all db sizes in mb for a server

    Option Explicit

    dim objDB

    with CreateObject("SQLDMO.SQLServer")

     .LoginSecure = TRUE

     .Connect "."

     for each objDB in .Databases

      wscript.echo objDB.Name & vbtab & objDB.Size

     next

    end with

  • RE: XML dump of major dataset

    or a possibly faster route may be to create a dts package that performs all your dumps in parallel to seperate files, then have a script merge them all together...

  • RE: XML dump of major dataset

    how does your 'quick and dirty' vbscript perform the operation?

    you could use a 'for xml' query to get xml data out into an ado stream and write it to a...

  • RE: How to find out the biggest table by size in a database?

    not sure why the ')' all show up as smileys.

  • RE: How to find out the biggest table by size in a database?

    Here's my script:

     

     

    select

     so.id as [OBJECT_ID],

     so.name as [OBJECT_NAME],

     coalesce(j_rows.rows,0) as [ROWCOUNT],

     coalesce(j_ru.sum_reserved,0) * cast(m.low as dec) / 1024 as [RESERVED (KB)],

     d.data * cast(m.low as dec) / 1024 as [DATA (KB)],

     (coalesce(j_ru.sum_used,0) - d.data) *...

  • RE: File Transer using SQL

    xp_cmdshell 'net use \\server\share password /user:domain\user & copy \\server\share\* c:\wherever & net use \\server\share /d'

     

    not good practice, but if you need to do it once. it works fine.

  • RE: A Better Solution

    in dts you would just create a source and destination text file. then create a transform task between them. then you can perform whatever actions you need on a column...

  • RE: Column to row

    assuming you have to analyze the query results given, dynamic sql is your friend. there may be a better way to get the numbers you want if you posted the...

  • RE: Can I copy (DTS) triggers

    have the dts package dynamically add the sql script in to drop and refresh the triggers.

    this function returns the drop and create sql for all triggers on a table. if...

  • RE: Dynamic server connections

    assuming nothing else needs to change but the connections with a datasource of "oldservername" the following might do what you want.

    strPackageName = "my package name"

    arrServerNames = array("s1","s2","s3","s4")

    for each strServerName in...

  • RE: unzip files using DTS

    gzip is free.

    exec master.dbo.xp_cmdshell 'gzip -d ... file'

    exec master.dbo.xp_cmdshell 'bcp ... file'

  • RE: select from now and back 6 months

    I believe it would technically need to be a between statement to ensure that there are no future dates included in the query.

    ie. BETWEEN DATEADD(m,-6,DATEDIFF(d,0,GETDATE())) AND GETDATE()

     

    if you want todays...

  • RE: Script to delete files older than x days?

    and yet another way. get the values from whatever and just call the sub. Don't forget to add the success constant to the main function. I've always been partial to datediff.

     

    'Strict

    Option...

Viewing 15 posts - 16 through 30 (of 30 total)