Forum Replies Created

Viewing 15 posts - 1,696 through 1,710 (of 2,458 total)

  • RE: Split row on two

    I think this should do the trick:

    WITH t1 AS

    (

    SELECT * FROM #Test1

    CROSS APPLY (VALUES ('Actual'),('Budget')) ab(RecType)

    )

    SELECT

    RecType,

    recID, MyDate,

    CASE...

  • RE: Convert Datetime to TIME

    1. The TIME datatype does not exist in 2005 (it was introduced it 2008)

    2. Your query appears to have been cut off.

  • RE: Using WHILE to avoiding Cursor

    It's also worth noting that sometimes a cursor performs much better than a loop (e.g. the WHILE logic that you are using).

    That said, and has already been mentioned, you...

  • RE: iterate

    DECLARE @i tinyint = 1;

    WHILE @i <= 5

    BEGIN

    If exists (select fieldID from #tmploginfo where status <> 0

    group by fieldID

    having count(*) > 0)

    begin

    backup log rdb to disk = N'C:\rdb1.trn'

    End;

    SET...

  • RE: DISTINCT use on views problem

    mattech06 (3/19/2015)


    Hi,

    I seem to have an odd situation.

    I have a view that when created holds about 40k of rows.

    when I use

    SELECT DISTINCT RefTypeWord FROM vw_Referrals where ClientRef = 'EPS' or...

  • RE: DISTINCT use on views problem

    twin.devil (3/20/2015)


    All the question you have asked means you yet to get to know the working of sql server. i have share you some links to understand what is what....

  • RE: using a subquery

    Sorry, I completely misunderstood your requirement. I will look at this again later today.

  • RE: T-SQL and CLR types for return value do not match

    You're returning a Table Valued Function so you need to return a IEnumerable (Note: CLR Table-Valued Functions)

    I have not written a CLR in a while but I think that

    public...

  • RE: using a subquery

    If by "remove log files" you want to delete the records in tempsysdatabase where the names are: rdb_log3 and rdb_log4

    This should work:

    DELETE FROM #tempsysdatabase

    WHERE name IN

    (

    select #tempsysdatabase.name, count (#temploginfo.FieldId) as...

  • RE: Grey out a paramter based on the value of another parameter?

    jbalbo (3/19/2015)


    Hi Alan

    Thanks for getting back so quick.

    I get most if it, just a bit confused on the dataset part.

    Here is the dataset I am using, if you could incorporate...

  • RE: Grey out a paramter based on the value of another parameter?

    I don't believe that you can disable/enable a parameter (I could be wrong but I am pretty sure that you can't).

    One thing you can do is this:

    You have a parameter...

  • RE: Splitting a field in the middle ??

    These problems are fun. If the data format is always the same (##/##/####) you could also do this:

    DECLARE @TestString VARCHAR(50)

    SET @TestString = 'LastName, FirstName (DOB: 01/01/1900)'

    SELECT SUBSTRING(@TestString, PATINDEX('%[0-1][1-9]/%', @TestString),10);

  • RE: Inline vs. Multi-Statement Table-Valued function, Temp Tables vs. CTEs?

    Had a second to kill. I put together a test to demonstrate why multi statement TVFs (mTVF) are terrible

    Using TempDB (a DB I know you have) this code will create...

  • RE: Microsoft and R

    Great article. There is a good article about this at on SQLMag.com. This is huge news indeed and is all the rage where I work.

  • RE: Hide field from Tablix based on query field valu

    PSB (3/18/2015)


    Hi,

    I have a report where there are fields like Field1,Field2,Field3,Field4 etc . In the report query there is a field named IsParentAccount . If it is 0 then I...

Viewing 15 posts - 1,696 through 1,710 (of 2,458 total)