Forum Replies Created

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

  • RE: Not a valid SQL Server database file - attach errors

    I have used detach/attach numerous times over the years with no problems.  This is a fully acceptable approach in moving a database on a local machine.  I will use a...

  • RE: query to find size of all tables in a database

    -- Create the temp table for further querying

    CREATE TABLE #temp(

     ServerName varchar(30),

     DBName  varchar(40),

     rec_id  int IDENTITY (1, 1),

     table_name varchar(128),

     nbr_of_rows int,

     data_space decimal(15,2),

     index_space decimal(15,2),

     total_size decimal(15,2),

     percent_of_db decimal(15,12),

     db_size  decimal(15,2))

    -- Get all tables, names, and sizes

    EXEC sp_msforeachtable @command1="insert into #temp(nbr_of_rows, data_space, index_space) exec sp_mstablespace '?'",

       @command2="update #temp set...

  • RE: Using GO in a stored procedure

    The word GO is the transaction or process terminator.  You do not need to terminate each step in a procedure but you must terminate the procedure.  Move your GO to...

  • RE: INsert 0 instead of NULL

    I assume that data already exists in the table so you must use and update statement not an insert statement.  For example:

    update t

    set intNavId = 0

    from TempItem t

    where intNavId is...

  • RE: Unknown backup message

    Check this link: http://support.microsoft.com/kb/306457

    You can find a vast amount of information by searching the Microsoft site.  I took your error text and pasted it into the search box.

  • RE: How to loopthrough all tables in the databases

    Sounds like suicide but here you go:

     

    if exists (select 1 from tempdb.dbo.sysobjects where name like '%work' and type = 'u')

    begin

     drop table ##work

    end

    declare @SQL nvarchar(1000),

     @Count int,

     @Loop int,

     @Name nvarchar(100)

    select name,0 process into ##work from sysobjects where...

  • RE: One Error (I don''''t know what is wrong)

    The columns TestID does not exist in the Catagories table.

  • RE: LiteSpeed backup for SQL 2000

    I tested LiteSpeed before settling on SQLSafe.  If I remember correctly LiteSpeed uses a proprietary compression algorithm just like every one else so you will need the tool to...

  • RE: Help on script optimization - Add fields to a table

    I might be missing something here but why not just follow these steps?

    1. Rename the old table.  Clean up indexes and constraints.
    2. Create a new table ordered as desired with the correct...
  • RE: How to find version of service pack?

    You have a few ways:

    1.  In Query Analyzer enter: select @@version

    2.  In Enterprise Manager:  Right click on the server name and select properties.  It is on the first page.

    3.  Look...

  • RE: Migrating Oracale database into Sql Server2005

    I have used a program called SQLWays.  It works pretty well but there will be things that will require manual recoding. 

    To read about the migration process and...

  • RE: Determining Read-Only Database Status

    This script will help you find the readonly databases on the server.  The real meat of the script is highlighted.  If a db is readonly you will receive a 1...

  • RE: Quickest way to clear all tables

    To clear the data from all tables in a database I have used this script many times successfully.  Just be careful.

    if exists (select 1 from tempdb.dbo.sysobjects where name like...

  • RE: Help with row_number()

    There was a  post on SQLServerCentral a while back that might be useful to you.  I have used it with a good deal of success.  Search the site for the...

  • RE: DTS Package failure

    My guess is that when you try to run the DTS from the enterprise manager you are logged onto that server on your local client.  The DTS package is hitting...

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