Forum Replies Created

Viewing 15 posts - 256 through 270 (of 444 total)

  • RE: There Must Be 15 Ways To Lose Your Cursors… Part 2: Just Put It in a S

    Another great Article.

    Thanks...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: No of columns matching in a row with percentage

    Try Count instead of SUM.

    OR

    Get the results seperately for each Union into another table

    for example,

    Insert into @t1

    Select ...

    and Get @@ROWCOUNT after each Insert.

    I think this will be...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: creating stored procedures

    Are you asking for the Currently Logged In users in the SQL Server?

    see master.dbo.sysprocesses.

    If you are willing to store the history of the Logged In Users, Create SP and...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Database design issue

    Code4Cash,

    I dont know the details of XML in SQL Server 2000, but there is alot you can do in SQL Server 2005.

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Query to return parent records with no child records

    I think it all depends upon the indexes on your data. The frist choice, as per my opinion, should be LEFT OUTER JOIN for consistent performance.

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: execute as user inside stored procedure

    By specifiying an execution context (such as by using the execute as user = 'user1') in which a module (such as a sp, trigger, queue etc) is executed, we can...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: execute as user inside stored procedure

    Plz check http://msdn.microsoft.com/en-us/library/ms191296.aspx.

    The example in the link will explain all to you.

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Handling NULL in existing project

    Its much better to set Default Values for such columns where NULLs can be inserted. This resolves many conversion issues.

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Database design issue

    How about storing data in XML Format and then XQuery the data on the maximum available elements...?

    --XML For Client 1

    Declare @vXML XML

    Set @vXML = ''

    Select x.header.value('@ClientID','int') ClientID,

    x.header.value('@C1','nvarchar(50)')...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Seleting Duplicate Records Into a new table

    It might be also like this (with the Insertion into another table Part...)

    Declare @tbl Table (id int, idv varchar(10))

    Insert into @tbl

    Select 1,'1' Union All

    Select 1,'2' Union All

    Select 3,'3' Union All

    Select...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: Query to return parent records with no child records

    Select ContactId from Contacts

    EXCEPT

    Select ContactId from Incidents

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: What is Deadlock

    Check this out...

    http://www.sqlservercentral.com/articles/Administration/exploringdeadlocks/616/

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: varchar vs int

    In such case when Source have different datatypes as compare to the destination, there are alot of comparisons to be made to avoid the conversion errors.

    You will have to...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: varchar(max) variable within a cursor. problem.

    If you are diciding that the XML is cutting short with the help of PRINT statement, let me tell you that the print statement prints the limited number of characters.

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • RE: BETWEEN Operator

    I think The condition should do it.

    where

    (delivery_date between @StartDate and @EndDate)

    And

    (

    (driver = e.emp_cd and (driver = @Driver or '%' = @Driver))

    or

    (helper = e.emp_cd and (helper =...

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

Viewing 15 posts - 256 through 270 (of 444 total)