Forum Replies Created

Viewing 15 posts - 1 through 15 (of 100 total)

  • RE: Aggregate Function For Last Value?

    You could try select top 1 [column_name] from table_name order by [column_name] desc

  • RE: How to find out Cascade Foreign Key info

    Try "sp_fkeys" for a start, look in BOL for arguments and value descriptions for the reult sets.

  • RE: notification of the query finished

    BKELLEY is spot on.  Go to tools-->options-->results

    You can choose the box "when query batch completes" and either select "play windows beep" or "play this WAV file"

  • RE: Ranking Result sets in TSQL

    Here is one way to do a rank:

    Taken from The Guru's Guide to Transact SQL pg. 190

    select ranking=identity(int), column1

    into #rank from table where 1=0 --creates empty table

    insert #rank (column1)

    select column1...

  • RE: Exporting data to Excel

    OK in summary, sounds like you have the DTS transformation setup based on your source table (or tables if this is a query) pointing at one Excel file (your target). ...

  • RE: Exporting data to Excel

    You will need to do the export in 2 stages if you use the wizard.  It can only point to one sheet at a time (think of it as one...

  • RE: Exporting data to Excel

    Not sure what your level of SQL Server is but...Another way to accomplish your goal:

    1)  Go to the database where your source table exists.

    2)  Right click and choose All Tasks

    3) ...

  • RE: Exporting data to Excel

    I would check to see if you are using the same sheet name (table name if you are building the sheet via T-SQL).  If you use the same name it...

  • RE: Exporting data to Excel

    Yes, the excel sheets will show up under the "table names" in the transformation task.  If you need to dynamically create sheets you can try building them as you go.

    To...

  • RE: help comparing 2 tables

    Take a look at the different join types in BOL.  In your case look at the outer joins section.

  • RE: backup job not working

    You may want to play with the naming a little but this is how I've done it a few times:

    declare @label varchar(16)

    set @label=(select convert(varchar,getdate(),112)+convert(varchar,getdate(),108))

    declare @sqlscript varchar(2000)

    set @sqlscript='exec sp_addumpdevice ''disk'',''DB_BKP'',''C:\DB_BKP_'+@label+'.bak''

    backup database...

  • RE: backup job not working

    Try this:

    exec sp_adddumpdevice 'disk','CE10_db',

    'c:\location\CE10_db.bak'

    Backup Database CE10 to CE10_db

    then drop the device when finished

  • RE: failed restore

    I like to use  sp_who2 to view my open connections and kill any open spid's connected to that db.

    OR, in EM go to Current Activity and right click on an...

  • RE: failed restore

    Looks like a stray user is blocking your way.  It could even be yourself if you have EM and Query Analyzer open.  I would kill all open connections and set...

  • RE: Linking SQL Server 2k with Oracle

    OK, we just solved this same issue - today.

    Here is what was done:

    Look for Oracle Bulletin "Note:215255.1"

    Then install Oracle Client 92040 Patch and manualy add permissions to ORACLE_HOME directory, then reboot...

Viewing 15 posts - 1 through 15 (of 100 total)