Forum Replies Created

Viewing 15 posts - 8,551 through 8,565 (of 8,753 total)

  • RE: Get Table Structure of Stored Procedure Output Table

    There where two table value functions introduced in 2012, sys.dm_exec_describe_first_result_set and sys.dm_exec_describe_first_result_set_for_object, the former takes a query string as a parameter, the latter an object id. The result sets are...

  • RE: Spatial, lines crossing

    An alternative, without the STCrosses function, filtering using STIntersects.

    😎

    DECLARE @GEOLINE TABLE

    (

    GEOLINE_ID INT IDENTITY(1,1) NOT NULL

    ,GEOLINE_LINE GEOMETRY NOT NULL

    );

    INSERT INTO @GEOLINE (GEOLINE_LINE)

    VALUES

    (geometry::STGeomFromText('LINESTRING(0 1,...

  • RE: Query Performance

    If the search string is only one word/pattern then a recursive approach could be an option. Or maybe a combination of the two?

    😎

    DECLARE @searchString nvarchar(255)= 'first';

    DECLARE @DISP_SIZE INT = 50;

    ...

  • RE: Convert Bigint time to datetime

    PSB (4/17/2014)


    Minutes

    1397750400000 Minutes

    23295840000 Hours

    970660000 Days

    2657522 Years

    The first birthday of Homo habilis?

    😎

  • RE: Need Query for Problem

    Just for fun (with nothing better to do), a recursive and a window function approach 😎

    Neither are perfect, more like a little twist....

    A resource hungry recursion:

    USE tempdb;

    GO

    IF EXISTS (SELECT *...

  • RE: How can I select lists like this

    redcn2004 (4/19/2014)


    when c0=1 and a0=b0 then print

    when c0=1 and c1=1 and a0=b0 and a1=b1 then print

    when c1=1 and a1=b1 then print

    when c1=1 and c2=1 and a1=b1 and a2=b2 then print

    ....

    ...

  • RE: ERD for Credit Card and Cash Payment Types

    Jacob Pressures (4/17/2014)


    Hi, Thanks for the response.

    In the relationship between Payment and Payment_Type tables, aren't the crows feet backwards?

    Yes, I missed the typo:w00t:

    I see your design i think between Payment...

  • RE: XML Schema validation in SQL Server

    fregatepllada (4/17/2014)


    Yes, I agree - but you could use a wrapper SP to catch an exception (RUSSIAN DOLLs model :-))

    Boils down to the same thing, the exception rolls back the...

  • RE: XML Schema validation in SQL Server

    fregatepllada (4/17/2014)


    Thank you for a great article!

    I am not quite agree with this statement "SQL Server has no specific functions or methods for validating XML".

    How about strongly typed XML...

  • RE: ERD for Credit Card and Cash Payment Types

    Jacob Pressures (4/16/2014)


    I have the following tables:

    Customer,

    Customer Credit Card,

    Credit Card

    Order

    But a customer can also pay with cash.

    Should I have a payment or transaction table which allow null IDs...

  • RE: Create Dynamics view

    I agree with rVadim that you should probably consider another approach if possible.

    Having said this, here an example code for a procedure to drop and create the view:

    CREATE PROCEDURE dbo.USP_REFRES_THE_LATEST_VIEW

    AS

    IF...

  • RE: Records not updated

    What about the values passed in the where clause, a typical mistake would be mixing up the two parameters.

    😎

  • RE: Records not updated

    dwilliscp (4/16/2014)


    I have a lookup records that feeds into a OLE DB Command. When I execute everything turns green and the lookup match output gives 847 rows.

    But looking at the...

  • RE: Create Dynamics view

    This should get you started, cannot do this in a view though, in a stored procedure it works fine.

    😎

    USE [tempdb]

    GO

    CREATE SCHEMA [SCHEMA01] AUTHORIZATION [dbo];

    GO

    CREATE SCHEMA [SCHEMA02] AUTHORIZATION [dbo];

    GO

    CREATE SCHEMA [SCHEMA03]...

  • RE: SSIS package connecting to multiple remote servers

    Check out this article, Control Flow Task Errors – Level 9 of the Stairway to Integration Services[/url]

    😎

Viewing 15 posts - 8,551 through 8,565 (of 8,753 total)