Forum Replies Created

Viewing 15 posts - 136 through 150 (of 241 total)

  • RE: FInding Text Box properties to remove duplicate values

    cljolly (8/25/2012)


    Thank you. Stupid question, where do I find remove duplicates? I right clicked on the field name and the header, but cannot find the properties that has...

    --Vadim R.

  • RE: FInding Text Box properties to remove duplicate values

    What you did wrong was deleting the column. Next time use cut/copy – paste. There could have been other settings and hidden expressions.

    Property name is HideDuplicates.

    --Vadim R.

  • RE: help with SQLCMD

    Lynn, OTF,

    I think what OP is talking about is redirecting STDOUT to a file (specified by the -o switch). This supposed to capture all output produced by SQL statements in...

    --Vadim R.

  • RE: Derived column

    If this is actually a GUID then you can also do this:

    DECLARE @UST VARCHAR(38) = '{784A4579-8689-438E-ADAA-9DCBC8A88AE7}';

    SELECT CAST(CAST(@UST AS UNIQUEIDENTIFIER) AS VARCHAR(36));

    --Vadim R.

  • RE: SQL Query for reporting.

    Try this:

    ;WITH AllCustomersCTE AS (

    SELECT Customer FROM CustTable

    UNION

    SELECT DISTINCT Cust FROM OrderTable

    )

    SELECT

    A.Customer

    ,COUNT(B.OrderNo) AS OrderTotal

    FROM AllCustomersCTE AS A

    ...

    --Vadim R.

  • RE: need to display column to row

    Try this:

    SELECT

    iSchoolYearCode

    ,cStudentID

    ,[Subject] = 'Math'

    ,Score = iMathScaleScore

    FROM #temp1

    UNION ALL

    SELECT

    iSchoolYearCode

    ,cStudentID

    ,[Subject] = 'Reading'

    ,Score = iReadingScaleScore

    FROM #temp1

    UNION...

    --Vadim R.

  • RE: Replicate value: Need urgent help. Thanks

    OK, simplified update:

    UPDATE #Cust SET

    @CustNo = Cust_No = COALESCE(Cust_No, @CustNo);

    --Vadim R.

  • RE: Replicate value: Need urgent help. Thanks

    Try this:

    CREATE TABLE #Cust(

    Urn INT

    ,Cust_No VARCHAR(20)

    );

    INSERT INTO #Cust(Urn, Cust_No)

    VALUES

    (2, 200000),

    (3, NULL),

    (4, NULL),

    (5, NULL),

    (6, NULL),

    (7,...

    --Vadim R.

  • RE: Replicate value: Need urgent help. Thanks

    1. Replication has completly different meaning in SQL Server from what you mean.

    2. Your 2 examples are not equivalent: in 1st it seems you want to take first not NULL...

    --Vadim R.

  • RE: How to delete data from Product table by ProductID in AdventureWorks

    I can think of 3 options:

    1. Delete data in all related tables first.

    2. Drop all relationships first.

    3. Change relationship rules for Delete (to Cascade, for example).

    --Vadim R.

  • RE: How to check more then one row for null by a value passed in

    I'm not sure I understand the following bolded areas:

    .Netter (8/23/2012)


    Hi all,

    I have a stored procedure that returns all records that match a certain criteria, i only want to show the...

    --Vadim R.

  • RE: PATINDEX to split a column into multiple columns

    Homework?

    You don't get value because pattern you've specified for PATINDEX doesn't match the data in the 4th row - there is no comma.

    --Vadim R.

  • RE: Unix Epoch to Sql Datetime Query

    Well, since it's number of seconds elaplsed since 1970-01-01...

    SELECT DATEADD(ss, 1345554248, '1970-01-01')

    SELECT DATEADD(ss, 1345554580, '1970-01-01')

    SELECT DATEADD(ss, 1345554271, '1970-01-01')

    SELECT DATEADD(ss, 1345554603, '1970-01-01')

    SELECT DATEADD(ss, 1345554033, '1970-01-01')

    --Vadim R.

  • RE: Time clarification while tuning

    It's either Milli or Micro depending on the settings in Tools - Options.

    Click on Duration column header and read the info.

    --Vadim R.

  • RE: CONVERT DATA COLUMN TO ROW WTIH COMMA

    Lokesh Vij (8/21/2012)


    Slight modification in CTE:

    WITH CTE AS(

    SELECT CAST( (SELECT CAST( col1 AS varchar(10))+ ','

    FROM...

    --Vadim R.

Viewing 15 posts - 136 through 150 (of 241 total)