Forum Replies Created

Viewing 15 posts - 46 through 60 (of 78 total)

  • RE: Date Conversion

    One more thing some date is like '25-01-2010 09:51:59' that is the valid date but can not be converted into date.

    what should I do.

  • RE: select count(*)

    Arjun Sivadasan (4/1/2010)


    vaibhav.tiwari (4/1/2010)


    Yes, with reference to reply of BigM that if schemaname is concatenate with the table name then sql server identify that it is the table name then...

  • RE: Date Conversion

    lmu92 (4/1/2010)


    You could use the following line to find the rows with bad data format:

    SELECT * FROM YourTable WHERE ISDATE(yourColumn) = 0

    Thanks a lot, My problem is solved, I never...

  • RE: select count(*)

    Sasidhar Pulivarthi (4/1/2010)


    hi Vaibhav,

    U are right...

    I tried the following two Queries

    SELECT COUNT(*) tbl_object

    tbl_object

    1

    SELECT COUNT(*) dbo.tbl_object

    Msg 102, Level 15, State 1, Line 1

    Incorrect syntax near...

  • RE: EXTRACT THE DATA FROM DB ....

    To avoid the cursor you can use this query as below

    SET QUOTED_IDENTIFIER OFF

    DECLARE @TABLE AS TABLE (Seq int identity(1,1), NAME VARCHAR(150))

    INSERT INTO @TABLE(NAME) SELECT '['+NAME+']' FROM SYSOBJECTS WHERE XTYPE ='U'

    --SELECT...

  • RE: How to findout columns involved in Joins, where clause, group by and having clause in a SQL Query?

    vijay.s (3/31/2010)


    For finding the all list of parameter used in SP you can use below mention query.

    SELECT sp.name, parm.name AS Parameter, typ.name AS [Type]

    FROM sys.procedures sp

    JOIN sys.parameters parm

    ON sp.object_id...

  • RE: How to findout columns involved in Joins, where clause, group by and having clause in a SQL Query?

    srinivas-356817 (3/31/2010)


    Hi Vaibhav, thanks for the reply.

    The approach suggested by you will be very good if we have a small SP which doesnt have any complexity code involved.

    But, if the...

  • RE: select count(*)

    COUNT(*) is nothing but count(1) or count(2) or any thing.

    So whatever you are writing just after Count(*) is alias for the value.

    even if you are using tablename it is not...

  • RE: Get Date only from getdate() function

    Dohsan (3/31/2010)


    SELECT CONVERT(VARCHAR(10), GETDATE(), 120) AS DT

    If you do a quick search you should be able to find a few sites with lists of the different date formats using CONVERT.

    Have...

  • RE: How to findout columns involved in Joins, where clause, group by and having clause in a SQL Query?

    srinivas-356817 (3/31/2010)


    So, no one has an answer for this..... 🙂

    That is not only question its about to work out to achive the aim to do it.

    Try to do it...

  • RE: Concatenate result sets

    Dugi (3/30/2010)


    vaibhav.tiwari (3/30/2010)


    Thanks for the suggestion and got the hint i can do it by row_number function.

    Thanks again

    Let us know how you did!?

    Something like this -

    CREATE TABLE #tempA (val...

  • RE: Get Date only from getdate() function

    As per required output -

    select REPLACE( convert(varchar,getdate(),111), '/', '-')

  • RE: Concatenate result sets

    Thanks for the suggestion and got the hint i can do it by row_number function.

    Thanks again

  • RE: Add and Remove Columns

    Can you go by below -

    IF EXISTS ( SELECT 1 FROM sys.objects WHERE Object_ID = OBJECT_ID('tempdb..#tablename') )

    BEGIN

    DROP table #tablename

    END

    CREATE table #tablename (name varchar(100))

    GO

    INSERT INTO #tablename

    SELECT 'table1'

    UNION ALL

    SELECT...

  • RE: Add and Remove Columns

    You can create a temporary table and insert all the table names in that and use dynamic query for that.

Viewing 15 posts - 46 through 60 (of 78 total)