Forum Replies Created

Viewing 15 posts - 391 through 405 (of 5,393 total)

  • RE: SQL Server agent job was not running last night.

    If the query returns rows, it means that something has changed the database status.

    Each row has user name and time when the change happened, which should help you track...

    -- Gianluca Sartori

  • RE: Drop SP TemDB

    Find the SPID running the procedure and kill it. There's no other way to drop a temp object without being able to run an explicit DROP from the connection that...

    -- Gianluca Sartori

  • RE: How To Union 2 table selects with WHEN Cases?

    CREATE TABLE Table1 (ItemId int)

    CREATE TABLE Table2 (ItemId int)

    INSERT INTO Table1 (ItemId) VALUES ('4');

    INSERT INTO Table1 (ItemId) VALUES ('2');

    INSERT INTO Table1 (ItemId) VALUES ('1');

    INSERT INTO Table2 (ItemId) VALUES ('3');

    INSERT INTO...

    -- Gianluca Sartori

  • RE: SQL Server agent job was not running last night.

    Something turned your database to readonly. Looking at the ERRORLOG you shoud see an entry similar to this before the job ran:

    Setting database option READ_ONLY to ON for database 'Yourdatabase'.

    If...

    -- Gianluca Sartori

  • RE: Using EXCEPT

    You could also round the float values to avoid the issue.

    -- Gianluca Sartori

  • RE: The EXECUTE permission was denied on the object sp_send_dbmail

    Ho did you grant permissions on the dbmail procedure?

    There's the role "DatabaseMailUserRole" in msdb for that. Is this what you used?

    -- Gianluca Sartori

  • RE: The EXECUTE permission was denied on the object sp_send_dbmail

    Does the job history include the "executed as..." Information?

    Does the user match the SQL agent service account?

    -- Gianluca Sartori

  • RE: The EXECUTE permission was denied on the object sp_send_dbmail

    The job is running under a different security context compared to the query run directly in SSMS. For T-SQL jobsteps, the owner of the job is the login that runs...

    -- Gianluca Sartori

  • RE: Powershell Script Logged in SQL?

    Powershell is not different from any other kind of client connecting to a SQL Server database, so no: nothing is logged out of the box.

    -- Gianluca Sartori

  • RE: SpBlitzIndex

    Probably not. Create the ones that are more likely to improve performance.

    -- Gianluca Sartori

  • RE: unicode data

    SQL Server stores unicode data using the UCS2 encoding. UTF8 is not supported in SQL Server.

    That said, there's nothing stopping you to store unicode data in SQL Server, even if...

    -- Gianluca Sartori

  • RE: SQL Server Core no GUI (SSMS)

    You've been a member for ten years: you should know that cross-posting won't earn you any more chances of getting a fast answer.

    -- Gianluca Sartori

  • RE: Join 2 reference values in one line ...

    Please post table scripts and some sample data, as well as expected output.

    See here for posting guidelines and tools to help you: http://spaghettidba.com/2015/04/24/how-to-post-a-t-sql-question-on-a-public-forum/

    -- Gianluca Sartori

  • RE: Prompt for Date Range?

    BTW, TOP 100 PERCENT / ORDER BY is totally ignored in views, so you may also delete it.

    -- Gianluca Sartori

  • RE: Prompt for Date Range?

    I would use an inline table valued function instead:

    -- create the function

    CREATE FUNCTION someFunctioName(@startDate datetime, @endDate datetime)

    RETURNS TABLE

    AS

    RETURN

    SELECT dbo.[!Act32CountyInfo].SubmittersEIN

    ,dbo.[!Act32CountyInfo].LocalAccountNumber

    ,dbo.[!Act32CountyInfo].WorkPSD

    ,dbo.[!Act32CountyInfo].TaxYear

    ,dbo.[!Act32CountyInfo].Period

    ,HR.EmployeeDemographics.EmployeeSSN AS [Social Security Number]

    ,dbo.[!Act32EmpName].LastName AS [Employee Last Name]

    ,dbo.[!Act32EmpName].FirstName AS [Employee...

    -- Gianluca Sartori

Viewing 15 posts - 391 through 405 (of 5,393 total)