Forum Replies Created

Viewing 15 posts - 241 through 255 (of 5,394 total)

  • RE: How to Build Inventory Server

    You can designate one of your servers as a Central Management Server.

    It stores only the server registration, so nothing more than a server name. If you want to store...

  • RE: Tree stucture

    It looks like a client formatting thing: I wouldn't bother doing that in T-SQL. Is there a particular reason why you need that?

  • RE: Send email when application user login to SSMS

    dallas13 (12/4/2015)


    Where exactly I said its 2014? I don't remember but if I said I m so sorry.

    And I put it in 2008 becuase 2005 and 2008 are still very...

  • RE: Send email when application user login to SSMS

    Let's see if I understand correctly:

    * you said you're on 2014

    * you posted in the 2008 forums

    * you are on 2005 instead

    OK, makes sense now 🙂

  • RE: Send email when application user login to SSMS

    Here is a quick and dirty example.

    First, you need an event session:

    CREATE EVENT SESSION [Audit_Logon] ON SERVER

    ADD EVENT sqlserver.LOGIN (

    SET collect_database_name = (1)

    ,collect_options_text = (0)

    ACTION(sqlserver.client_app_name, sqlserver.client_hostname, sqlserver.server_principal_name)

    )

    WITH (

    MAX_MEMORY...

  • RE: Send email when application user login to SSMS

    I had to do something quite similar this year and I can share my experience with it.

    Personally, I would avoid both logon triggers and service broker for this particular problem.

    Logon...

  • RE: TempDB usage per active session

    My pleasure, Matija!

    Was the query using a lot of tempdb space? I'm curious to know how OPTION RECOMPILE made it stop doing so. Maybe a wrong cached plan?

  • RE: Queryquestion

    You also need to specify the database where the query should run. It's one of the parameters.

    As an alternative, you can qualify the object names in the query with three-part...

  • RE: Queryquestion

    You need to escape the quotes inside the query: ' (single quote) has to be turned to '' (two single quotes, not double quote).

    EXEC msdb.dbo.sp_send_dbmail

    @profile_name = 'MailProfile1',

    @recipients = 'someone@microsoft.com',

    @subject =...

  • RE: Database Server Memory always showing 98%

    OK, so what's the problem?

  • RE: Database Server Memory always showing 98%

    SQL Server tries to use all the available RAM by default. This is expected and desirable in a dedicated SQL Server box.

    If you have other applications running on the same...

  • RE: Need comma separated output

    SELECT id,

    [Output] = ISNULL(STUFF(

    CASE C1 WHEN 1 THEN ',A' ELSE '' END +

    CASE C2 WHEN 1 THEN ',B' ELSE '' END +

    CASE C3 WHEN 1 THEN ',C' ELSE ''...

  • RE: Duplicate reference to the same sql server instance, not an alias?

    My money is on port 1433. I often use this technique.

    mark.williams 37494 (11/18/2015)


    In the port config for the instance in config manager do you happen to have a default port...

  • RE: Find duplicates in datasets

    I suppose this should do:

    INSERT INTO SurveyInterface.tblLoadISFNotification (OperatingEntityNumber, SDDS, SurveyCodeId, QuestionnaireTypeCodeId, ReferencePeriod, DataReplacementIndicator, PrecontactFlag, SampledUnitPriority)

    SELECT

    OperatingEntityNumber

    ,[SDDS]

    ,[SurveyCodeId]

    ,[QuestionnaireTypeCodeId]

    ,[ReferencePeriod]

    ,[DataReplacementIndicator]

    ,[PrecontactFlag]

    ,[SampledUnitPriority]

    FROM (

    SELECT

    cnt = COUNT(*) OVER (PARTITION BY ISF.OperatingEntityNumber, ISF.QuestionnaireTypeCodeId),

    ISF.OperatingEntityNumber

    ,[SDDS]

    ,[SurveyCodeId]

    ,[QuestionnaireTypeCodeId]

    ,[ReferencePeriod]

    ,[DataReplacementIndicator]

    ,[PrecontactFlag]

    ,[SampledUnitPriority]

    FROM dbo.tblISF40201507 ISF

    JOIN...

  • RE: Find duplicates in datasets

    In a query that contains GROUP BY clause, all the columns in the select list must be in the GROUP BY clause on in an aggregate function.

    Example:

    SELECT ISF.OperatingEntityNumber, ISF.QuestionnaireTypeCodeId, COUNT(*)

    FROM...

Viewing 15 posts - 241 through 255 (of 5,394 total)