Forum Replies Created

Viewing 15 posts - 76 through 90 (of 168 total)

  • RE: Substring on NText data type

    try this

    Create

    table ntexttest (sno int, val ntext)

    Create

  • RE: Creating Multiple Rows Repeating Info from one Row in a table

    try this

    Create table #orders(orderid int, quantity int)

    insert #orders

    select 1,3 union all

    select 2,1 union all

    select 3,4 union all

    select 4,2

    GO

    Create procedure orderproc as

    begin

     declare @oid int, @cnt int,@i int

     Create table #temp(orderid int, quantity...

  • RE: I ruined my query

    Its very simple logic,

    In All the four columns One Column only contains the value and all other's contains 0, Then dont allow any value to be true for two conditions,...

  • RE: I ruined my query

    Replace the totOpen column def in Query with this, hope it will work

    CASE WHEN Payday IS NOT NULL OR WRcurrentStatus = 110 OR WRcurrentStatus = 40 THEN '0' ELSE DEaltKeyValue END...

  • RE: Count and multiple Group By

    use the following query to get the desired output

    declare

    @test-2 table (col_1 int, col_2...

  • RE: Return MAX(COUNT(Column)) value

    same result using CTE's

    WITH ACTE ([ID],[Name],[NameCount]) AS

     (

     SELECT [ID], [Name], COUNT([Name]) NameCount FROM  MyTable1  GROUP BY [ID], [Name]

    &nbsp

     SELECT B.[ID],MIN([NAME]) AS [NM]

     FROM...

  • RE: Escape Characters

    try this

    select * from employeedetails where edescription='employee name is ''john jackson'' and state is ''ca'''

  • RE: sp_executesql problem

    This can allow upto 16000

    declare @sql1 varchar(8000),

     @sql2 varchar(8000),

    @ret int

    set @sql1=N'Select * from '

    set @sql2=N'sysobjects;'

    exec( @sql1 + @sql2)

    I think you need to capture return code, that is not possible with...

  • RE: bug of "synonym" ??

    But I am able to create a synonym for a SP and successfully executed that SP using synonym in SQL 2005

    CREATE

    SYNONYM [dbo]

  • RE: bug of "synonym" ??

    Four-part names for function base objects are not supported in Creation of Synonymns

    -- BOL

     

     

  • RE: sp_executesql problem

    If you are using SQL2005 use this

    declare

    @sql nvarchar(max)

    declare

    @ret int

    set

    ...

  • RE: Alter Table Add Column Fails during update

    try this

    SET

    TRANSACTION ISOLATION LEVEL READ COMMITTED

    GO

    Begin

    Tran T2

  • RE: COALESCE for NonEmpty

    I think this is what you are looking for

    select coalesce(nullif(ColumnA,''),nullif(ColumnB,''),nullif(ColumnC,''),nullif(ColumnD,'')) from tab

    But performance wise its too bad I guess

     

  • RE: Check if Index exists

    try this

    select distinct o.[name],case i.indid when 1 then 'PrimaryKey'  else i.[name]  end as IndexName

    from sysindexes i

    inner join sysobjects o on

    i.id=o.id

    inner join sysindexkeys k on

    k.id=o.id and k.indid=i.indid

    where o.xtype='U' and i.[name]...

  • RE: how convert float to nvarchar

    I think you concluded in a wrong way

    It is possible to  convert float datatype to nvarchar datatype

Viewing 15 posts - 76 through 90 (of 168 total)