Forum Replies Created

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

  • RE: Hyphen delimited string manipulation

    Hi

    I used a different splitter function which is as follows:

    CREATE FUNCTION [dbo].[Split](@String varchar(MAX), @Delimiter char(1))

    returns @temptable TABLE (items varchar(MAX)) ...

  • RE: Hiding columns with all zero values in dynamic pivot query

    Sean,

    Sorry for the late reply.

    Since the requirement needed urgent solution we fixed it from the code behind.

  • RE: Hiding columns with all zero values in dynamic pivot query

    Sean,

    Thanks for the answer.

    This will work only when the designations are known beforehand,right?

    In my case the designations are not fixed and we take the values from the designation table.

    Any solution...

  • RE: Hiding columns with all zero values in dynamic pivot query

    Sorry Sean..

    I should have tested the order of data in the insert statement.Please find the orrect statements below:

    inserting to' ProjectAssignment'

    -----------------------------------

    insert into dbo.ProjectAssignment

    select 'A-6140','2014/03/04','P1','L30025',0,0,1,NULL,'','','',3,''

    insert into dbo.ProjectAssignment

    select 'A-6141','2014/03/04','P1','L30025',0,0,1,NULL,'','','',3,''

    insert into dbo.ProjectAssignment

    select...

  • RE: Hiding columns with all zero values in dynamic pivot query

    Creating designation table

    ---------------------------

    CREATE TABLE [dbo].[Designation](

    [RecID] [bigint] IDENTITY(1,1) NOT NULL,

    [DesignationID] AS ('D'+CONVERT([nvarchar](40),[RecID])),

    [DesignationName] [nvarchar](100) NULL,

    [Description] [nvarchar](500) NULL,

    [Status] [smallint] NULL,

    [JobLevel] [nvarchar](10) NULL

    ) ON [PRIMARY]

    sample data

    -------------

    INSERT INTO dbo.Designation

    select 'Group Test Manager','Group Test...

  • RE: Hiding columns with all zero values in dynamic pivot query

    Hi

    Sorry for not adding the sample query.

    Here it is:

    -------------------------------------------------------------------------------------------------------------------

    DECLARE @RunQry NVARCHAR(MAX),@DesignationNames NVARCHAR(MAX),@Designation NVARCHAR(MAX),@DesignationTotal nvarchar(MAX)

    SELECT @Designation=COALESCE(@Designation+',','') + QUOTENAME([DesignationID])

    FROM [dbo].[Designation] WHERE...

  • RE: Need help with employee hierrarchy

    One more thing...

    If the original query is enough and it would be better without ordering added,pleas let me know that too.Any suggestions other than the ordering part,that would improve the...

  • RE: Need help with employee hierrarchy

    Hi,

    Sorry for that Jeff.You can find the sample data here.

    -------------------------------------------------------

    declare @Tmp Table(EmpId nvarchar(10),FullName nvarchar(60),DesignationName nvarchar(100),ReportingMgr nvarchar(60),LoginMgr nvarchar(60))

    insert into @Tmp values('A-4981','Rupen','VP-SD','Moris','Rupen')

    insert into

  • RE: Find birthdays of a week

    I finally solved the problem by using the following query:

    SELECT FullName,convert(varchar,dob,103) Birthday

    from @People

    WHERE DATEPART(wk, DATEADD(yy, DATEPART(yy, @CurrDate)

    - DATEPART(yy, dob), dob)) = DATEPART(wk,@CurrDate)

    and datediff(d,convert(datetime,(cast(datepart(d,dob)as varchar)+'/'+

    ...

  • RE: Find birthdays of a week

    Thanks Lowell..

    I have tried your query as well as the one that follows:

    SELECT FullName,convert(varchar,dob,103) Birthday

    from @People

    WHERE DATEPART(wk, DATEADD(yy, DATEPART(yy, GETDATE())

    - DATEPART(yy, dob), dob)) = DATEPART(wk, GETDATE())

    and...

  • RE: Find birthdays of a week

    Thanks Ken,but this does not give me the expected result.Sorry if i had not made myself clear in the previous post.

    What i need is the upcoming birthdays of the current...

  • RE: How to pass parameter from select results to update query using SP?

    See whether this works:

    --------------------------

    update a set userid='Amolr' from wuser a inner join cliente b on a.fid = b.fid where b.c_number in

    (

    select b.c_number from wuser a

    inner join cliente b...

  • RE: TDE and Filestream

    If the file stream does not get encrypted,why is the answer 'YES'?I want my points back............

  • RE: How can i create a Unique constraint that allow multiple nulls values

    But a filtered index is possible only in SQL 2008.

  • RE: How can i create a Unique constraint that allow multiple nulls values

    Unique keys do not allow NULL values.As 'NULL' values cant be compared to check for uniqueness,the values of the unique column are considered to be equal.This means that a column...

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