Forum Replies Created

Viewing 15 posts - 16 through 30 (of 30 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...

  • RE: Database offline

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

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

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

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

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

  • RE: Rollback data

    Do you have a back up of the database?

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

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

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

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

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

  • 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 + ' = ' +...

  • 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

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

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