Forum Replies Created

Viewing 15 posts - 1 through 15 (of 18 total)

  • RE: Parameter sniffing

    However will this affect anyway in output? Please note I am not asking about performance!!!

  • RE: Parameter sniffing

    Here every time in SP GetIt this statement "set @Name = 'Pelle'" is executed.

    So every time record of Pelle will be displayed.

    Please comment on this.

    I have tested this...

  • RE: distinct columns

    CREATE TABLE TmpTable (Col1 varchar(10),Col2 int)

    SELECT Col1,Col2 FROM TmpTable

    Col1Col2

    A10

    A11

    B12

    B8

    B15

    C18

    C24

    C28

    C35

    SELECT DISTINCT Col1 FROM TmpTable

    Col1

    A

    B

    C

    SELECT DISTINCT Col1,Col2 FROM TmpTable

    Col1Col2

    A10

    A11

    B8

    B12

    B15

    C18

    C24

    C28

    C35

    USE BELOW FOR YOUR PURPOSE

    SELECT * FROM

    (

    SELECT

    ROW_NUMBER() OVER ( PARTITION BY Col1...

  • RE: Nice Script But With Some Problems

    Try to use option (maxrecursion 0) as shown below

    SELECT TableRelation,DependentTable

    FROM cte

    option (maxrecursion 0)

  • RE: How to write the Following Equevalant Query

    You can use BCP command for this.

    Try searching use of BCP command.

  • RE: Replace

    remove this from your code

    [highlight=#ffff11]

    and

    [/highlight]

    This is added by SQLServerCentral's editor

    Use constants instead of subquery.

  • RE: Replace

    You can directly write your value in below sub query.

    This sub query may lead to some problem like multiple records in select statement error etc.

    where (cast(am.itime as varchar[highlight=#ffff11])<=(select...

  • RE: Replace

    If you have two different conditions like am.time <= and am.time>= then better to write if else statement and copy paste your query with required modifications.

    I am not able to...

  • RE: Replace

    Ok what you actually trying to do by this:

    replace('$filter', 'itime', 'am.itime')

    ?

    It may be some condition like itime>=something or item<=something right ?

  • RE: Replace

    Hi,

    Sorry you didn't understood my question.

    Just provide me original query and let me know what condition you want there in "Where" condition then I can help you.

    Thanks,

  • RE: Replace

    Please provide me the condition on which your filter statement will be .

    Lets say

    condition 1

    filter should be $filter = '1'

    condition 2

    filter should be $filter =...

  • RE: Replace

    Instead of using replace use CASE WHEN ... THEN END syntex

    like

    and $filter = CASE WHEN CONDITION THEN 'VALUE' ELSE 'VALUE' END

  • RE: Replace

    Instead of using replace use CASE WHEN ... THEN END syntex

    like

    and $filter = CASE WHEN CONDITION THEN 'VALUE' ELSE 'VALUE' END

  • RE: Replace

    Hi,

    Here '$filter' word does not contains 'itime' thats why it is not being replaced.

    Check below statement for your reference.

    select REPLACE('abcdef','ef','EF')

  • RE: Error arthematic operations inside varchar @variable

    Set @DeltaSizeSQL =

    'Select SUM(A.DeltaCount * B.AvgRecordSize) from ' + +@Linkedserver +'.'+@Databasename+'.dbo.parameterhistory A Join Operations..DatasetTables B (Nolock) ON A.ReferenceObjectName = B.TableName ...

Viewing 15 posts - 1 through 15 (of 18 total)