Forum Replies Created

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

  • RE: Any query for selecting unwanted indexes ?

    Try looking at sys.dm_db_index_usage_stats

    Although a word of warning - although an index may not be used 'frequently', it doesnt mean that it's not valid!!

    Do you have the data model of...

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

  • RE: Database offline

    Is there an error message? Are there active connections to the db?

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

  • RE: SSIS package runs in BIDS, but not through GUI or Job

    Open each of the script tasks individually, and right click - build them... Do they build successfully?

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

  • RE: Rollback data

    There are various things you can do to monitor what is happening on your database, and give yourself enough information to roll back mistakes.

    Try looking into:

    Change Data Capture (CDC) http://msdn.microsoft.com/en-us/library/bb522489.aspx

    Using...

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

  • RE: Rollback data

    Restore the backup to a seperate database, identify the rows which were updated incorrectly, and write a query to reverse the action.

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

  • RE: Rollback data

    To be honest, I'm not sure you'll get the answer you're looking for here (i.e. Do steps x, y and z and you will magically have your original data back).

    As...

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

  • RE: Rollback data

    Do you have a back up of the database?

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

  • RE: Service Broker - Executing stored Proc on another database.

    Which account are you using to run the package? Does it have permissions on both dbs?

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

  • RE: Fixed Width issue

    I'd probably create a function to do this, and use this to do the conversion.

    Create function dbo.udf_StuffString

    (@Value float)

    Returns Varchar(12)

    as

    Begin

    Declare @Multiple int,

    @Output varchar(12)

    Set@Multiple = casewhenCHARINDEX('.',reverse(cast(@Value as varchar(12)))) > 0

    thenPOWER(10, ...

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

  • RE: Fixed Width issue

    And to handle the variable number of decimal places, you could try:

    select POWER(10, cast(CHARINDEX('.',reverse(cast(@Amount as varchar(10))))-1 as int))

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

  • RE: Fixed Width issue

    Try somethign like this:

    declare @Amount as varchar(10)

    select @Amount = cast(cast(20.55 * 100 as int) as varchar(10))

    SELECT STUFF(@Amount, 1, 0, REPLICATE('0', 12 - LEN(@Amount)))

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

  • RE: Getting error in query to remove duplicates, merge statement, HELP

    Could you provide some sample data?

    It sounds like you're either returning duplicate records, or your logic doesn't provide mutually exclusive sets.

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

  • RE: Column Name & matching string as variables

    The single quotes are only closing the SQL string - they're not identifying the string you're passing to it as a string.

    WHERE '+@FieldName + ' = ' +...

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

  • RE: Download, unzip and dump the data from a file in FTP share to a table?

    I'd take a look at SSIS (MS Sql Server Intergration Services). With a script task for the zip/unzip of files, you should be able to easily automate your requirement.

    Try http://msdn.microsoft.com/en-us/library/ms169917.aspx...

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

  • RE: SQL 2008 Datatype-Length Help needed

    What data types are you planning on inserting into the table? If you know that, you should be able to answer your own question 🙂

    If you're allowing users to input...

    _____________________________________________________________________
    Disclaimer - The opinions expressed by the mouth are not necessarily those of the brain

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