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 strongm 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. JayKusch

    Identify a Snapshot DB

    Is there a system parameter like DATABASEPROPERTYEX that would identify whether a DB is a snapshot? Thanks! Thanks J. Kusch
  2. JayKusch

    Get date of previous Sunday

    Morning, I know I am close BUT I still can't get this code snippette to return the date of last sunday (as in 1/9/2011 - format of date does not matter). Here is what I have so far (borrowed from a web page): DECLARE @LastSundayNight DateTime SET @LastSundayNight = GetDate() SELECT CASE...
  3. JayKusch

    Too much egg nog - Query Help - lol

    PERFECT! Thanks J. Kusch
  4. JayKusch

    Too much egg nog - Query Help - lol

    I am trying to update a record set with the last restore date that is captured with a TOP clause in the code. Here is the code (that does not work): UPDATE MyTable SET MyDate = ( SELECT TOP 1 RESTORE_DATE FROM MSDB.dbo.RESTOREHISTORY WITH (nolock) JOIN MyTable ON...
  5. JayKusch

    Remote Call insert local table from exec of a remote SP

    OK .. brain dead for a Friday - lol So I have a server where I am "trying" to call a remote stored proc to load a local table. Somthing like ... INSERT INTO Admin.dbo.MyTable ( Col1, Col2 ) EXEC MyRemoteDB.dbo.MySP Now Admin.dbo.MyTable is the local table and MyRemoteDB.dbo.MySP...
  6. JayKusch

    OpenRowSet query being refused

    I have an instance of 08R2 running on my box with an instance of 05SP3. Running the query in the 05 instance returns the result sets from the remote server just fine. When I run it from the R2 instance it failes with the followig error: OLE DB provider "SQLNCLI10" for linked server "(null)"...
  7. JayKusch

    Line up commands in Mgt Studio

    Bingo! Thanks Bill Thanks J. Kusch
  8. JayKusch

    Line up commands in Mgt Studio

    Just the reverse for me ... works in 05 (some setting I hit quite a while back) but not in 08R2. Trying to hunt down where its set at. Thought it was a part of IntelliSense. Thanks J. Kusch
  9. JayKusch

    Line up commands in Mgt Studio

    I know I have toggled it on in the past but where do you set Mgt Studio to show you how your commands line up? In other words, If I use an IF\ELSE statement I want to be able to highlight the IF and it shows me the corresponding ELSE further down in the code. Thanks! Thanks J. Kusch
  10. JayKusch

    Simple Insertion of records

    OK ... figured it out ... INSERT INTO TableB (DBName, Field1, Field2, Field3) SELECT [Name], '', 0, 0 FROM Master.dbo.SysDatabases WHERE NOT EXISTS (SELECT * FROM TableB WHERE TableB.DBName = Master.dbo.SysDatabases.[Name]) AND Status = 536 Thanks J. Kusch
  11. JayKusch

    Simple Insertion of records

    Looking to stay away from triggers. Want to do this code-wise. I will keep working at it. Thanks Thanks J. Kusch
  12. JayKusch

    Simple Insertion of records

    Ahhh ... one issue ... using SysDatabases (system table) so we cannot add that trigger. Looking for code that would look something like: If database(s) in sysdatabases set to offline then add database NAME from SysDatabases to TableB IF it does not already exist. If it exists already in...
  13. JayKusch

    Simple Insertion of records

    TableA has database name column and active\inactive flag TableB has database name When we inactivate database(s) in TableA we want code later on to insert the newly deactivated database(s) name(s) into TableB. I know code with use an IF NOT EXIST on the TableB insertion code, just not able to...
  14. JayKusch

    UPDATE Statement dilema

    I have a table (TableA) that needs to have a date field updated with a MAX(Date) from another table (TableC). To add to this ... We need to join to a TableB to get an ID to have it hook up right. So TableA looks like: DBName varchar(100), CreateDate DateTime TableB looks like: DBName...
  15. JayKusch

    MSForEachDB - Create Stored Proc

    I figured it out use the ole nasty 'cursor' - lol Thanks! Thanks J. Kusch
  16. JayKusch

    MSForEachDB - Create Stored Proc

    Afternoon, I need to figure out the syntax to create a stored procedure in every one of our database (all 1200+) which is part of a stored procedure execution logging process. I have been trying to get MSForEachDB to work. Any ideas on how to accomplish this task? Thanks Thanks J. Kusch
  17. JayKusch

    SQL DB Move

    in Enterprise Manager, drill down on the database and choose detach. Once detached, move the physical file to its needed share. Once in place, r-click on the database tree label in EM and choose attach. Point the location of the TLog (which should be showing as missing) to the new location...
  18. JayKusch

    Find position of last occurrence of character

    Say I have a string of: R:\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\model.mdf and I want to know the position of the last \ (which would be position 43). Thanks! Thanks J. Kusch
  19. JayKusch

    Installed sql 2005 instance and can no longer access 2000

    What error message are you receiving when you try to start the old SQL 2000 services? Thanks J. Kusch
  20. JayKusch

    SQL Standard Edition Licensing Question

    That is not permitted ... you can have multiple "instance" of SQL server but it has to be on the same physical machine. Having a backup and a production server would require 2 licenses. Thanks J. Kusch

Part and Inventory Search

Back
Top