Forum Replies Created

Viewing 15 posts - 3,721 through 3,735 (of 8,731 total)

  • RE: rows not retrieved with my query

    Sean Lange (11/25/2015)


    lnardozi 61862 (11/25/2015)


    In the script, you're selecting into a variable. No matter how many rows there are, the variable only gets set once.

    Not quite, the OP is using...

  • RE: Problems with CTE (recursive queries)

    I see the same thing as Sean, there's no hierarchy in what you posted. There's a parent/child relationship, but it won't go multiple levels.

    And please, next time post sample data...

  • RE: How can I find the source of data for a DB

    I don't have much experience on any of those and don't have much spare time to play around and set something. Maybe someone else can give you something more specific.

    To...

  • RE: Filestream filegroups

    Rune Bivrin (11/25/2015)


    Where can I buy SQL Server 2015?:hehe:

    You don't need to buy it, is a free update that comes with Win10 Server Edition.

  • RE: How can I find the source of data for a DB

    You could monitor sys.dm_exec_sessions or set a trace or extended events session.

  • RE: SQL Unpivot

    You just need to add them to the derived table.

    DECLARE @SAMPLE TABLE (ID CHAR(4),Salary INT,Employee_Tax1 INT,Employee_Tax2 INT,Employer_Tax1 INT,Employer_Tax2 INT);

    INSERT INTO @SAMPLE(ID,Salary,Employee_Tax1,Employee_Tax2,Employer_Tax1,Employer_Tax2) VALUES ('A001',1000,120,95,125,105);

    SELECT

    X.ID

    ,X.[Desc]

    ,X.Earn_Ded

    ,X.Employer_Tax

    FROM ...

  • RE: Today's Random Word!

    Alvin Ramard (11/24/2015)


    Spam

    Plenty

  • RE: Help: Calculated CASE Statement in Query

    jeff.joseph85 (11/24/2015)


    It's basically the same isn't it? For the most part? SQL code is recognized by Microsoft Access. Anyway, I'm just trying to sort this out. We...

  • RE: Help: Calculated CASE Statement in Query

    You have it "backwards".

    Try: CASE When TITLE.MilSrchPerfrmed is null then 0 else 1 end AS MSP

  • RE: Help with Query

    If you don't know, throwing queries at us won't work. We have no idea on how does your environment looks like. You mentioned that you're having an issue with your...

  • RE: Need help with a CASE statement

    A shorter version with sample data:

    USE tempdb

    GO

    CREATE TABLE #Test( pieces int);

    WITH

    E(n) AS(

    SELECT n FROM (VALUES(0),(0),(0),(0),(0),(0),(0),(0),(0),(0))E(n)

    ),

    E2(n) AS(

    SELECT a.n FROM E a, E...

  • RE: Where clause prevents index seek

    That doesn't explain why would the query use the underscore in the WHERE clause.

    If this is an export for a migration and not a permanent process, I suggest that you...

  • RE: Help with Query

    SQL Server 2005 doesn't have IIF(), you need to replace it with a CASE.

    SQL Server uses DISTINCT instead of DISTINCTROW.

    Access and SQL Server syntax are not the same, so...

  • RE: Need help in Converting SQL SERVER 2000 QUERY In 2008

    I believe this should be equivalent.

    SELECT sum ( isnull ( s.amt_du_ic, 0 ) ),

    d.pmt_dte,

    r.juris_id,

    c.acna,

    ...

  • RE: find duplicate loginame

    Something like this?

    SELECT login_name

    FROM sys.dm_exec_sessions AS DES

    GROUP BY DES.login_name

    HAVING COUNT( DISTINCT DES.host_name ) > 1

Viewing 15 posts - 3,721 through 3,735 (of 8,731 total)