Forum Replies Created

Viewing 15 posts - 91 through 105 (of 216 total)

  • RE: TOP 3 date per id

    sorry Boss,

    You have to change your Query, You have to use acs in place of dsc like

    select top ' + convert(varchar,@ntop) + '  r_id,dt from tbl_date group by r_id,dt order...

  • RE: TOP 3 date per id

    Hi,

    Use this Query it may be benificial to you :

    Declare @COUNT INT,@str varchar(4000),@ntop int

    SELECT @COUNT=COUNT(distinct r_id) FROM tbl_date

    set @ntop=@count * 3

    print @ntop

    set @str='select * from

       (select top ' +...

  • RE: Compute with Sub-Query

    Hi,

    use this Query, I hope your problem is soved :

    select a.CompanyName,a.OrderCount from

    (Select

        C.CompanyName

      , (Select Count(0) From Orders Where CustomerId = C.CustomerId) OrderCount

    From

      Customers C

    )  a

    Order By

      OrderCount

    Compute

      Sum(OrderCount)

  • RE: Creating a trigger

    Hi,

    I want to a solution,

    when a user enter his login & password in the Query Analyser or Enterprise Manager to enter the Sql Sever,i want that  particular user  can't access the...

  • RE: Creating a trigger

    Hi,

    thanks for what so ever help but i am not using any GUI. I want to do it from backend.

    Is there any idea???

    Regards,

    AMIT GUPTA

     

  • RE: Login Issue::

    Thanks for replaying,

    but there is any way to hide master and tempdb databases,so that when a user login into his user name & password to Query Analyser.

    It will show only...

  • RE: Login Issue::

    Thanks for your answer,Greg.

    I know this thing, which you are saying,

    but if you purchase a space to host a site,they will create a database of a particular name...

  • RE: Login Issue::

    Hi Guys!!

    You have any answer for this.

    I want to create a user which can access only a particular  Database and also i don't want to permit such user to access...

  • RE: Attach Damaged .Mdf file

    Hi,

    After following all the steps. when i opened the database in Emergency Mode.

    I can not able to execute a single command overe it. It gives an error

    " Could...

  • RE: Attach Damaged .Mdf file

    Hi,

    Thanks for your valuable hints but still i am not able to restore it.

    Do you have any other way to retrieve it.

     

    Thanks

    Amit

  • RE: Group by and what else... ?

    Hi,

    Use this Query & Function to proceed :

    Create  function fn_Grouped(@id int,@sep varchar(1)) returns varchar(200)

    as

    Begin

    Declare @str varchar(200)

    select @str=coalesce(@str,'') + convert(varchar,dt,113) + @sep + convert(varchar,bk_int) +

    @sep + convert(varchar,cid) + @sep from tbl_grp...

  • RE: Stored Function Tables

    Hi,

    If i am not wrong you are talking about the Table type functions, which returns the Multiple values like a table.

    as

    Create function fn_tbl(@val varchar) returns Table

    as

    begin

    end

     

    thanks,

    Amit

     

  • RE: Median Calculation

     

    Hi,

    You can try this Query : i have taken the Pubs Database Title table .

    First i create a temp table like :

    1)  SELECT *  into ##titles

         FROM #titles

         WHERE price...

  • RE: Attach Database Problem

    Hi Rama,

    As you said that you are New So, You can't do it.

    if you provide the mdf file to me than i sured to you i will attach it.

    Regards,

    Amit Gupta.

     

     

     

  • RE: Need results in a fixed field length regardless of acutal size

    Hi,

    Use this Query,

    select 'ABC' + space(6 - len('ABC'))

     

    Regards,

    Amit Gupta,

     

Viewing 15 posts - 91 through 105 (of 216 total)