Forum Replies Created

Viewing 15 posts - 61 through 75 (of 443 total)

  • RE: Script to Clean Logs Up

    Try using the following Changed Code;

    declare @db varchar(100),

    @dbid int,

    @hidb int,

    @sql as varChar(500)

    set @hidb = (select max(dbid) from master..sysdatabases)

    set @dbid = 0

    While @dbid <= @hidb

    Begin

    set @db = (select name From master..sysdatabases...

  • RE: String Help - LTRIM ?

    How about writing a function as;

    -- ================================================

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    -- =============================================

    -- Author:Atif Sheikh

    -- Create date: 28-05-2010

    -- Description:Trim Non Alpha Characters

    -- =============================================

    ALTER FUNCTION fnTrimNonAlphaCharacters

    (

    @pString varchar(max)

    )

    RETURNS varchar(max)

    AS

    BEGIN

    Declare @vTable Table (Ch Char(1))

    Declare...

  • RE: Query

    khushbu (5/26/2010)


    Hi,

    Currently i'm not able to think of any good solution. Can someone pls hep me

    I have a table which can have same emp name and manager name. Now same...

  • RE: can any one please guide

    Glad it helped you.:-)

    Please be sure to specify the test data yourself when you post any other question. It really helps to find quick and better answer.

  • RE: Primary-Foreign Key

    Its wrong design but Why not?

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    CREATE TABLE [dbo].[Table1](

    [PKID] [int] NOT NULL,

    [FKID] [int] NULL,

    CONSTRAINT [PK_Table1] PRIMARY KEY CLUSTERED

    (

    [PKID] ASC

    )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY =...

  • RE: Trace table inserts/updates

    Try RPC Completed.

    It will Give You sp_executesql 'INSERT ...'

    And sp_executesql 'INSERT ...'

  • RE: select query issue

    Kingston Dhasian (5/27/2010)


    A LEFT OUTER JOIN with the same table again will give you the desired result

    SELECTEmp.Emp_Name, Sup.Emp_Name Sup_Name

    FROMEmployee Emp

    LEFT OUTER JOINEmployee Sup ONEmp.Supervisor_ID = Sup.Emp_ID

    Looking at the data in...

  • RE: Print vs. Select

    For checking the flow of T-SQL code in SSMS, PRINT statement is fine. For debugging, another option is RAISERROR. You can check the details @ http://www.sqlservercentral.com/articles/SQL+Puzzles/quickhintsforusingtheraiserrorcommand/2114/

    And also @ http://msdn.microsoft.com/en-us/library/ms178592.aspx

  • RE: List of parameters having default values

    Gopi Muluka (5/24/2010)


    you may want to look at "SYS.PARAMETERS"

    In SYS.PARAMETERS, we do have Has_Default_Value bit and Default _Value column. But these are related to the CLR objects. http://msdn.microsoft.com/en-us/library/ms176074.aspx

  • RE: List of parameters having default values

    lmu92 (5/24/2010)


    It's more than unlikely to get those values, since there are several ways to assign a default value to a parameter (e.g. as part of the CREATE PROCEDURE statement,...

  • RE: spliting nested string

    Anamika (5/21/2010)


    Hi,

    Thanks for the inputs. both are working fine

    thanks,

    regards,

    Ami

    If the comma separated list is as long as 1000s of list items, it would be better to with tally table solution....

  • RE: INNER JOIN and WHEwhat is order execute?

    You can see it in the Execution Plan.

  • RE: Use Dynamic SQL to Improve Query Performance

    CirquedeSQLeil (5/20/2010)


    Atif Sheikh (5/20/2010)


    Dynamic SQL is the last thing to do.

    Sometimes Dynamic SQL is quite useful. There are alternatives to using case statements or dynamic sql (such as...

  • RE: Backup\ Restore completion Status.

    vk-kirov (5/19/2010)


    Kari Suresh (5/19/2010)


    where and how we can use this? Anybody can explain with an example?

    For example, it may be very useful when a big transaction rolls back and you...

  • RE: SSMS Features

    ziangij (5/17/2010)


    Atif Sheikh (5/17/2010)


    Even without selecting Table Designer from Tool bars, right click the workspace of Table design screen and select 'Generate Change Script ...'. 🙂

    thanks 🙂 didn't know about...

Viewing 15 posts - 61 through 75 (of 443 total)