Forum Replies Created

Viewing 15 posts - 6,661 through 6,675 (of 8,753 total)

  • RE: Create a trigger to update the same to table

    Hi and welcome to the forum, here is a quick and straight forward sample, should be enough to get you passed this hurdle.

    😎

    Note: Suggest that you revise the design...

  • RE: bulk insert question

    Lynn Pettis (11/2/2014)


    Eirikur Eiriksson (11/2/2014)


    Quick suggestion, use the FIRSTROW = n, n = number of rows to skip

    😎

    Actually, the n is the number of the row to start with. ...

  • RE: bulk insert question

    Quick suggestion, use the FIRSTROW = n, n = number of rows to skip

    😎

  • RE: do you have a StripNonNumeric ITVF function?

    Jeff Moden (10/30/2014)


    Now we're cooking with gas! Well done! I had eye surgery today (lens replacement) and can't see so well yet and can't spend much time in...

  • RE: do you have a StripNonNumeric ITVF function?

    Adding some gas supplies for the stove, first there are five methods for replacing logical operators or comparison operator combination equivalent thereof with a single comparison operator.

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    ...

  • RE: Extract based on a similar element name and store the value in the same column

    Looking at the XML and the expected results, it is apparent that something is missing in the description;-)

    The code below is slightly verbose in order to be self explanatory, note...

  • RE: Character value count

    Quick window function based solution with xml path concatenation, should get you passed this hurdle.

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    IF OBJECT_ID('dbo.data_set') IS NOT NULL DROP TABLE dbo.data_set;

    create table dbo.data_set (id int primary...

  • RE: Pattern Matching SQL

    Some additional knowledge/information/logic is needed to complete this as djj mentioned, here is some quick code to get you started.

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    IF OBJECT_ID('dbo.Webs') IS NULL

    BEGIN

    Create Table dbo.Webs

    (

    FullURL nvarchar(255)

    );

    Insert...

  • RE: simple xml to table

    serg-52 (10/30/2014)


    🙂

    Alternatively use OPENXML

    DECLARE @xmlDocument nvarchar(max)

    SET @xmlDocument = N'<table>

    <tr>

    <td>cell1</td>

    <td>cell2</td>

    <td>cell3</td>

    </tr>

    <tr>

    ...

  • RE: do you have a StripNonNumeric ITVF function?

    Tweaking the code a little bit more shaves off approximately 17 percent, here is an all in one code

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    --===== Create the 100K row test table

    ...

  • RE: Using single talking marks (') with Dynamic SQL?

    Quick thought, the dynamic sql should be nvarchar so use NCHAR(39) where it's needed, it is on the other hand not needed for the parameters, use sp_executesql and the execution...

  • RE: do you have a StripNonNumeric ITVF function?

    Thanks Alan and Jeff, very good job indeed!

    This is really the SSC community at it's best and although I haven't had any time to look properly into this, Alan and...

  • RE: simple xml to table

    A quick solution, should get you passed this hurdle

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    DECLARE @TXML XML = '<table>

    <tr>

    <td>cell1</td>

    <td>cell2</td>

    <td>cell3</td>

    ...

  • RE: Sum values with an If?

    Quick suggestion, use a case statement

    😎

    USE tempdb;

    GO

    create table dbo.fun_test(

    packtype nvarchar(50),

    price money)

    insert into dbo.fun_test

    values ('Single','2'),('Monthly','25.00'),('Monthly','27.00'),('Monthly','23.50'),('Single','2'),('Deposit','1'),('Deposit','2')

    select

    PackType

    ,count(*) as Records

    ,sum(CASE ...

  • RE: do you have a StripNonNumeric ITVF function?

    Little clean up in the logic, now it looks pretty good

    😎

    /********************************************************************

    -- Stripping out any non-numerical characters

    -- EE 2014-10-28 Inital coding

    -- EE ...

Viewing 15 posts - 6,661 through 6,675 (of 8,753 total)