Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. jester777

    Are my SQL Indexes Being Used? Utilization Rate?

    One of the EventClass options you can monitor with SQL Profiler is 'Execution Plan'. What you can look for in each of the plans shown are things like INDEX SEEK, INDEX SCAN, CLUSTERED INDEX SEEK, what you will see further along that line is the INDEX being used. Therefore you can get an idea of...
  2. jester777

    Automatically Grow File

    It is in the sysfiles of each database. See this description of sysfiles from BOL. growth int Growth size of the database. A value of 0 indicates no growth. Can be either the number of pages or the percentage of file size, depending on value of status. If status contains 0x100000, then growth...
  3. jester777

    Locating table's size

    Try this bit of code. Collects info about each user table in the database and sorts the output into largest table first. declare @id int declare @type character(2) declare @pages int declare @dbname sysname declare @dbsize dec(15,0) declare...
  4. jester777

    Log Shipping and moving db's problem

    Is this SQL7 or 2K? There are several internal tables used by log shipping, if you have moved the tran log dump sites then you will probably have to change the values in the tables. Don't forget these values are for directory shares so you may have to remove the old share and create a new share...
  5. jester777

    MSSQL Path

    Try this if you are on SQL2K USE master GO DECLARE @install_path NVARCHAR(260) EXEC sp_MSgettools_path @install_path OUTPUT SELECT @install_path GO
  6. jester777

    MSSQL Path

    The info you are looking for should be in the registry. the following SQL code reads the registry and returns the value for the SQL Code path and SQL data path. This is on SQL7, the same principal works on SQL2K but you may have to change the keys. Declare @Instpath varchar(50), @Datapath...
  7. jester777

    Determining source for DTS at run time

    I've not actually done this myself but ! The DTSRUN command allows you to specify a value for a global variable using the /A parameter. You should be able to see this value in the DTS package at run time. Check BOL for more info.
  8. jester777

    [CRITICAL] Transaction Logs and Restoring

    Looks like you are trying to restore a transaction log dump taken before the db dump you are trying to apply it to. You have to make sure you apply the tran log dumps in the correct order starting with the first one after the db dump you are restoring. The RESTORE command has a parameter called...
  9. jester777

    [CRITICAL] Transaction Logs and Restoring

    When you restore the DATABASE make sure you use the NORECOVERY option as part of the RESTORE statement. This should then allow you to RESTORE the transaction log dump. The default for RESTORE is RECOVERY which means no more transaction log dumps can be applied (which I guess you did with the db...
  10. jester777

    Restore database from Query Analyzer

    Yes it will work. The logical names are stored as part of the database dump so the restore knows what the names should be.
  11. jester777

    [CRITICAL] Transaction Logs and Restoring

    That is restoring from a transaction log file, you can't do a database restore up to a certain time !. In your first post you said the backups were screwed, does this mean you cannot go back to a DB dump to then apply the tran log dumps?
  12. jester777

    [CRITICAL] Transaction Logs and Restoring

    The RESTORE command has a STOP_AT parameter STOPAT = date_time | @date_time_var Specifies that the database be restored to the state it was in as of the specified date and time. If a variable is used for STOPAT, the variable must be varchar, char, smalldatetime, or datetime data type. Only...
  13. jester777

    Restore database from Query Analyzer

    Yes this can be done. A database dump can be restored to a database with a different name. You need to be careful of the filenames of the restored database files so that you don't overwrite the original database files. You do this by using the WITH MOVE option. EG If you have backed up you...
  14. jester777

    Database in suspect mode

    sp_resetstatus does not recover your database, it just updates a system table in the master database removing the suspect flag. If your database is in a suspect state you should recover it from your latest db & tran log backups.
  15. jester777

    Use of [, ] around column names

    The use of square brackets allows you to use reserved words or identifiers with invalid characters in as names for columns, databases, views etc. Eg hyphen (-) is invalid in a name create table fred-1 (int fred) fails but create table [fred-1] (int fred) works. Eg2 CASE is a reserved word...
  16. jester777

    Setting and Configuration

    You can also use xp_regread as below Declare @Instpath varchar(50), @Datapath varchar(50) exec master.dbo.xp_regread @rootkey='HKEY_LOCAL_MACHINE', @key='SOFTWARE\Microsoft\MSSQLServer\Setup', @value_name='SQLPath',@value=@Instpath output print @Instpath exec master.dbo.xp_regread...
  17. jester777

    Setting and Configuration

    The path and Data path are stored in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\MSSQLServer\Setup\SQLPath & SQLDataRoot. You can get hold of these inside SQL by using The SQL_DMO registry object properties SQLRootPath and SQLDataRoot.
  18. jester777

    SQL 7 database restore

    When you install SQL you define which character set to use, which sort order to use and whether case sensitivity is important. When you backup a database it has to be restored to a server running the same settings. In your case I would say your XP machine happens to have the same settings as...
  19. jester777

    SQL Server Auditing

    You can change the audit level of SQL server to log details of login times etc. In SQL Enterprise Manager, right click your server and select PROPERTIES. On the security tab you will see Audit Level, if you select All you will get tthe following info (taken from books online) All Audit on both...
  20. jester777

    Restore Help Needed

    I think using the FILE=1 parameter the way you want is only available if you are doing a partial restore (ie specify the PARTIAL keyword). If you don't specify PARTIAL then FILE=1 means restore the first backup set on the backup device you are using. The best solution here is to specify MOVE...

Part and Inventory Search

Back
Top