Forum Replies Created

Viewing 15 posts - 2,026 through 2,040 (of 2,356 total)

  • RE: Strange issue with database restore

    You have been given the answer to your problem in both the error message you are getting, and in the post that Phil provided.

    Use WITH REPLACE in your restore...

  • RE: Table design for normal form respect

    Aside from the fact that neither TableB or TableC have a primary key defined, what is wrong with the structure in the script you posted?

    Neither of the two possible solutions...

  • RE: How Do I Combined These Two Select Statements?

    sgmunson (6/18/2015)


    A couple of additional notes:

    3.) I simplified some of the coding to use BETWEEN.

    Enjoy...

    You probably do not want to use BETWEEN for a datetime field.

    If you are...

  • RE: How Do I Combined These Two Select Statements?

    sgmunson (6/18/2015)


    sqlnoob2015 (6/17/2015)


    I am having the hardest time combining these two select statements into one. Can anyone give me some advice on these?

    Thank you!!

    Basically i want my...

  • RE: Need to track logins to all databases

    mark.dickinson (6/18/2015)


    Michael L John (6/17/2015)


    Sorry, I saw this post and ran out the door after I published the code.......

    3. I don't think Database name is part of the EventData Function....

  • RE: Need to track logins to all databases

    1. Mark, if you don't have a database of DBA-type stuff, give it some thought. Don't give anyone other than the DBAs permission to it and collect whatever you...

  • RE: Question about xp_dirtree Procedure

    Polymorphist (6/17/2015)


    My team is deciding to go with code-only solutions rather than continue our heavy reliance on SSIS.

    At the risk of sounding like a certain grumpy expert, why???...

  • RE: How Do I Combined These Two Select Statements?

    Union will not work.

    This will:

    SELECT

    case

    when Substring(gl_account.id, 5, 3) = 001 then 'Group 1'

    when Substring(gl_account.id, 5, 3) = 002 then 'Group 2'

    when Substring(gl_account.id, 5, 3) = 003 then 'Group...

  • RE: Need to track logins to all databases

    Sorry, I saw this post and ran out the door after I published the code.

    1. I have a DBAUtilities database on all my servers. This holds auditing tables,...

  • RE: Need to track logins to all databases

    CREATE TRIGGER [Server_Logon_Trigger]

    ON ALL SERVER

    FOR LOGON

    AS

    INSERT INTO DBAUtilities.dbo.Server_Logon_History(EventType, PostTime, ServerName, LoginName, LoginType, SID, ClientHost, IsPooled)

    SELECT EVENTDATA().value('(/EVENT_INSTANCE/EventType)[1]', 'nvarchar(100)'),

    EVENTDATA().value('(/EVENT_INSTANCE/PostTime)[1]', 'datetime'),

    EVENTDATA().value('(/EVENT_INSTANCE/ServerName)[1]', 'nvarchar(512)'),

    EVENTDATA().value('(/EVENT_INSTANCE/LoginName)[1]', 'nvarchar(512)'),

    EVENTDATA().value('(/EVENT_INSTANCE/LoginType)[1]', 'nvarchar(512)'),

    EVENTDATA().value('(/EVENT_INSTANCE/SID)[1]', 'nvarchar(512)'),

    EVENTDATA().value('(/EVENT_INSTANCE/ClientHost)[1]', 'nvarchar(512)'),

    EVENTDATA().value('(/EVENT_INSTANCE/IsPooled)[1]',...

  • RE: SQL Server Backup with SAN backup

    See this thread:

    http://www.sqlservercentral.com/Forums/Topic1694442-2893-1.aspx

    What likely will happen in the event you need to restore from a SAN backup is inconstancy.

    As was suggested, test your RSTORES regularly. I would suggest...

  • RE: Group By in Sub query

    This may be better

    SELECT

    count(hc),

    CS,

    S_W,

    SUM(case when Reg_Temp = 'Reg' then 1...

  • RE: Queries running against to a table

    Does this work?

    SELECT TOP (100)

    COALESCE(DB_NAME(ST.dbid),

    DB_NAME(CAST(PA.value AS INT)) + '*', 'Resource') as [Database_Name]

    ...

  • RE: Problem in procedure

    yb751 (6/15/2015)


    Did you try using GO?

    Example:

    First SP

    GO

    Second SP

    This will not work inside a procedure.

    Can you post your code?

  • RE: log file does not match primary file

    karend211 34657 (6/15/2015)


    I do see in the sql log that when the snapshot backups are taken that the database IO is frozen, backup is taken & IO is resumed. ...

Viewing 15 posts - 2,026 through 2,040 (of 2,356 total)