Forum Replies Created

Viewing 15 posts - 1,726 through 1,740 (of 2,894 total)

  • RE: Is Cursor Really Not Good?

    Cursors are not Really Good or Really Bad!

    They designed and should be used for relevant tasks.

    However your example is not one of them...

  • RE: Bulk Insert works but leave's spaces in data

    Try to drop and recreate destination table with SET ANSI_PADDING OFF, it's still supported in SQL 2012

  • RE: Messages Tab (Query)

    It's nothing to do with T-SQL or a query as query itself cannot direct its output.

    You can do it in your application by handling ADO InfoMessage event.

  • RE: Rewriting with NON ANSI

    ....

    Please note the importance of good code formatting - it making the code much easier to read.

    Also, I would classify your query as "noodles" and suggest refactoring your inner selects...

  • RE: use print statement in stored procedure

    itskanchanhere (4/19/2012)


    Please do not use print statement in your Sp. If some one trys to execute that sp from any other client apart from SSMS it will fail since Print...

  • RE: Is it possible to SUM(@variable)?

    DECLARE @sql NVARCHAR(4000)

    DECLARE iCursor as CURSOR FOR

    SELECT MeasureID, MeasureName FROM ControlTable

    OPEN iCursor

    FETCH NEXT from iCursor into @MeasureID, @MeasureName

    WHILE (@@FETCH_STATUS = 0)

    BEGIN

    --This is where I am having problem

    SET @sql = 'select...

  • RE: The DELETE statement conflicted with the REFERENCE constraint

    Ten Centuries rated!

    Please provide DDL for both sides of REFERENCE constraint and SQL your are running.

    I guess you just missing something in your order...

  • RE: Is it possible to SUM(@variable)?

    Build Dynamic SQL inside of cursor and execute it.

  • RE: how can i insert in udf

    hbtkp (4/17/2012)


    ok. i already posted my formula for cumulative.

    i hv another prov

    i have delcare variable

    declare @abd datetime

    now i need to get 1 date from function

    like

    select @abd = fromdate from item2(@rdfd)

    fromdate...

  • RE: error with insert statement

    SOURCE: [MAS90ID] [varchar](50) to DESTINATION: [MAS90ID] [nvarchar](10)

    SOURCE: [SLXID] [varchar](50) to DESTINATION: [SLXID] [nvarchar](10)

    Run the following:

    SELECT * FROM [dbo].[Channels2] WHERE LEN(MAS90ID) > 10 OR LEN(SLXID) > 10

  • RE: Index Rebuild and Fillfactor

    > So I can have different fillfactor for indexes on the same table depending on the columns they use...

    Yes you can

    > Should I also consider the indexes' INCLUDE columns?

    Yes you...

  • RE: error with insert statement

    Some of records in source table have string values larger than allowed by definition of column at destination.

    DDL for [Test].[dbo].[Channels2]?

  • RE: how can i insert in udf

    hbtkp (4/16/2012)


    it snot running total,if you see it carefully,

    its not just adding values. sometimes its adding 1 ,sometimes it minus 1

    Can you tell please which rows of provided samples do...

  • RE: how can i insert in udf

    Looks like OP need just a running total.

    My be sample provide is not very exact 🙂

  • RE: use print statement in stored procedure

    zojan (4/17/2012)


    If you want log steps of the SP_ you can use loging into log_table.

    ...

    Not good option for SQL Server as there is no direct equivalent to autonomous transactions like...

Viewing 15 posts - 1,726 through 1,740 (of 2,894 total)