Forum Replies Created

Viewing 15 posts - 361 through 375 (of 761 total)

  • RE: case statement in where clause

    Rock from VbCity (6/4/2012)


    The example given by vinu512 did not work for me, the query below with CASE does work using the sample data I used. I do not like...

  • RE: creating pivot tbl

    Like This?

    --Creating Table

    create table sal

    (empId nvarchar(10),

    sal_comp nvarchar(10),

    IncomeAmount int)

    --Inserting Sample Data

    insert into sal values ('SPIKE', 'basic', 100)

    insert into sal values ('SPIKE', 'da', 300)

    insert into sal values ('SPIKE',...

  • RE: case statement in where clause

    You can't do that the way you are doing it because it clashes with the "=" operator you used for Field2 in your Where Clause. But, you can do it...

  • RE: Eliminating Duplicate Rows

    The following query will give you the result that you are expecting:

    Select Column1, Column2, Column3 From

    (Select *, ROW_NUMBER() Over (Partition By Column1 Order By Column1) As rn From Ex) As...

  • RE: ssrs 2008 r2, passing multiple values to a parameter

    michael vessey (6/1/2012)


    looks like you could use a TVP (table value parameter)

    it's bets not to pass delimeted strings in as parameters

    try the following - (example code only)

    CREATE TYPE xtype as...

  • RE: Multiply two columns in SQL nd store

    GilaMonster (6/1/2012)


    vinu512 (5/31/2012)


    GilaMonster (5/31/2012)


    Why persist it?

    I added it to my code because of the following property of using Persistence:

    - Any update in referenced column will be synchronized automatically in computed...

  • RE: Sting comma Separator

    This might help:

    --Creating Table

    Create Table Ex

    (ProjectName varchar(50),

    WorkType varchar(50),

    Status varchar(50),

    TagSetName varchar(50),

    TagValues varchar(50) )

    --Inserting Sample Data

    Insert Into Ex

    Select 'Wrong retainer on Front back Lh Focus','Tollgate004_', 'On Track',...

  • RE: ssrs 2008 r2, passing multiple values to a parameter

    How about something like this?

    --Creating Table

    Create Table Ex

    (PhoneNo bigint)

    --Inserting Sample Data

    Insert Into Ex

    Select 2018087621

    Union ALL

    Select 2018267812

    Union ALL

    Select 2018464973

    Union ALL

    Select 2018562444

    Union ALL

    Select 2018661915

    Union ALL

    Select 2018660946

    Union ALL

    Select 2018369037

    Union ALL

    Select 2018563128

    Union ALL

    Select 2018552019

    Union...

  • RE: Guys emergency (database usage is more than 90 %)

    Please be a little more elaborate about it. What does your application do?....What kind of queries/procedures/functions are you executing from the Front End?

  • RE: Multiply two columns in SQL nd store

    GilaMonster (5/31/2012)


    Why persist it?

    It is not necessary to use the Persisted Property according to the OP's original requirements.

    I added it to my code because of the following property of using...

  • RE: Insert Row Based on Another Row?

    bduff (5/31/2012)


    Yeah that helps, how do you execute it on all instead of specifing 544?

    Thanks

    Ben

    This will work for you in all cases without specifying any value for Column1. You can...

  • RE: Insert Row Based on Another Row?

    If there are heaps of rows and different values in Column1 then you can use a procedure as follows:

    --Creating Table

    Create Table Ex

    (Column1 int,

    Column2 varchar(64),

    Column3 int Identity(51284, 1) Primary...

  • RE: Multiply two columns in SQL nd store

    Sony Francis @EY (5/31/2012)


    Use computed column and set peristed in ON

    Yes, I agree with Sony. If you want something like an update on the whole table then its better...

  • RE: Multiply two columns in SQL nd store

    SQL Kiwi (5/31/2012)


    vinu512 (5/30/2012)


    You can use a CTE to update your table as follows:

    No! Try that with this data:

    Insert Into Ex1(id, product, price, qty) Values(1, 12, 13, 3)

    Insert Into...

  • RE: Insert Row Based on Another Row?

    Something like this?

    --Creating Table

    Create Table Ex

    (Column1 int,

    Column2 varchar(64),

    Column3 int Identity(51284, 1) Primary Key)

    --Inserting Sample Data

    Insert into Ex

    Select '1970', 'blogs'

    Union ALL

    Select '1970', 'collaboration'

    Union ALL

    Select '1970', 'discussion_board'

    Union ALL

    Select '1970', 'course_email'

    Union...

Viewing 15 posts - 361 through 375 (of 761 total)