Forum Replies Created

Viewing 15 posts - 2,776 through 2,790 (of 13,469 total)

  • RE: Need help on improving a where clause, thanks.

    I think you'd just extend the WHERE statements in the query to also compare the @RoleId :

    how about this?

    and g.ID in

    (Select ID From Groups

    ...

  • RE: DatabaseMail

    5.5.1 implies you did not set up your db mail to send the basic authentication to have the username and password:

  • RE: Convert Columns to Row in SQL

    jeganbenitto.francis (12/16/2013)


    Can Anyone please help me in below requirement

    i have a row as below

    1 AAAA BBBB CCCC DDDD EEEE FFFF GGGG HHHH

    I...

  • RE: Login failure for user 'NT AUTHORITY\ANONYMOUS LOGON'

    whoops i cross posted from anotehr post;

    can you show us /script out your linked server?

    that would help us diagnose the issue for you.

  • RE: Login failure for user 'NT AUTHORITY\ANONYMOUS LOGON'

    look at the stored procedure in question...i'd bet it is referencing a linked server. the login is failing at the linked server because whoever is calling it doesn't have mapped...

  • RE: BCP Out Failure About Login Failure

    my first guess is permissions; xp_cmdshell doesn't typically use the network permissions you expect.

    run this command, and it can help you see if the user SQL uses for disk access...

  • RE: Time issues

    and somethign from my snippets, which is grouping data into half hour intervals:

    With MySampleData

    (AgentID,State,StartTime,EndTime,Duration)

    AS (

    SELECT '1234','NotReady',Cast('2011-04-05 08:00:00' AS datetime),Cast('2011-04-05 08:00:05' AS datetime),'5' UNION ALL

    SELECT '1234','Ready','2011-04-05 08:00:05','2011-04-05 08:01:00','55'...

  • RE: Time issues

    can you post the data as consumable sql stateemtns we can paste into SSMS, along with the datatypes?

    something like this is an example

    ;WITH MyCTE([Times],[ACD],[Other],[Outb])

    AS

    (

    SELECT '8:30AM','0:00:00','0:00:00','0:00:00' UNION ALL

    SELECT '9:00AM','0:09:48','0:00:00','0:00:23' UNION ALL

    SELECT...

  • RE: Remove DATE ONLY from datetime column

    assuming you want AM/PM? here's a couple more examples; one keeps the milliseconds, the other is stuffed to remove the milliseconds to leave seconds +am/pm:

    select right(convert(varchar,getdate(),131),14),

    STUFF(right(convert(varchar,getdate(),131),14),9,4,'')

  • RE: Select ALL logins, users, and user groups shown in SSMS Security > Logins

    select * from sys.server_principals

    that will have domain users, as well as all the built in users; the sql_logins is a limited view of that same data(WHERE type_desc = 'SQL_LOGIN').

  • RE: SQL Credentials to Access Network File

    can you see if you add the option for readonly, if it will work?

    i have this saved in my snippets:

    SELECT * FROM OPENROWSET('MSDASQL',

    ...

  • RE: Create a View with OPTION (FORCE ORDER)

    h.tobisch (12/13/2013)


    use option (force order) when selecting from the view

    note: eight year old thread.

  • RE: Long Path Names to Files on SQL Server Installation

    cathy.baker (12/13/2013)


    I'm getting a rule check fail "Long path names to files on SQL Server Installation media failed" when installing SQL 2012 Standard edition from a network share. What...

  • RE: Check for a list of special characters in a column

    yes you can, SQL supports some regular expressions:

    WITH

    MyLastNames(LName) AS

    (

    Select 'DeCaprio@gmail' UNION ALL

    Select 'Pitt[phone]' UNION ALL

    Select 'Schwarzenegger(phone)' UNION ALL

    Select 'Wahlberg' UNION ALL

    Select 'Damon' UNION ALL

    Select 'Willis'

    )

    SELECT

    B.LName

    FROM ...

  • RE: Stored Procedure EXEC in Excel

    you could create a temporary stored procedure.

    whether you can do it through excel, i'm not sure, but thios example works just fine; your proc obviously woudl be more complex

    CREATE PROCEDURE...

Viewing 15 posts - 2,776 through 2,790 (of 13,469 total)