Forum Replies Created

Viewing 15 posts - 991 through 1,005 (of 1,246 total)

  • RE: Persisted computed column not acting very persisted...

    Phil Parkin (10/9/2015)


    Jason A. Long (10/9/2015)


    Phil Parkin (10/9/2015)


    I found a 'GetNumbers' function here [/url] and that, when combined with Jeff's function, allows you to take the CLR out of the...

  • RE: Persisted computed column not acting very persisted...

    Phil Parkin (10/9/2015)


    Here's an iTVF version of the query I posted earlier.

    Correct me if I'm wrong (a strong possibility), but I don't think we're able to reference TVFs in computed...

  • RE: Persisted computed column not acting very persisted...

    Luis Cazares (10/9/2015)


    This might seem weird, but have you tried to recreate the table?

    I kept getting an error which seemed to be replicating your problem saying that the column couldn't...

  • RE: Persisted computed column not acting very persisted...

    Phil Parkin (10/9/2015)


    I found a 'GetNumbers' function here [/url] and that, when combined with Jeff's function, allows you to take the CLR out of the equation ... at least for...

  • RE: Persisted computed column not acting very persisted...

    Question, using this as an example: A6304158-2, is there always a single alpha character at the beginning followed by one or more numeric values (0 - 9) followed by a...

  • RE: Persisted computed column not acting very persisted...

    Who am I kidding? Test table & data is always required...

    USE RandomTests;

    GO

    CREATE TABLE dbo.PersistedColumnTest (

    BillID VARCHAR(20)

    );

    INSERT dbo.PersistedColumnTest (BillID) VALUES

    ('5345227-2'),('6209822-2'),('6209822-2'),('6721796-2'),('6721796-2'),('6721796-2'),('6721796-2'),('6719008-2'),('6210153-2'),('6203656-2'),

    ('6209822-2'),('6209822-2'),('6700546-2'),('6680192-2'),('6700546-2'),('6619450-2'),('6721796-2'),('6145204-2'),('6145204-2'),('5906198-2'),

    ('7390138'),('7390138'),('7390130'),('7390138'),('7390138'),('7390138'),('7390130'),('7390138'),('7390130'),('7390130'),('7390130'),('7389910'),

    ('7389910'),('7390501'),('7390101'),('7390101'),('7390101'),('7395511'),('7395511'),('7390101'),('A6761374'),('A6761374'),('A6761374'),('A6761374'),

    ('A6760682'),('A6760682'),('A6760682'),('A6760682'),('A6745076'),('A6745076'),('A6745076'),('A6745076'),('A6745076'),('A6745076'),('A6757524'),

    ('A6757524'),('A6757524'),('A6757524'),('A6760741'),('A6762905'),('A6762905'),('A6371075-2'),('A6371075-2'),('A6371075-2'),('A6371075-2'),

    ('A6376568-2'),('A6376568-2'),('A6376568-2'),('A6376568-2'),('A6315422-2'),('A6315422-2'),('A6315422-2'),('A6315422-2'),('A6363316-2'),('A6363316-2'),

    ('A6363316-2'),('A6193029-3'),('A6193029-3'),('A6089801-3'),('A6089801-3'),('A6315423-2');

    GO

    CREATE FUNCTION dbo.GetInvoiceIDFromBillID

    /* ===========================================================

    10/08/2015 JL, Created to strip the InvoiceID out or...

  • RE: Which one is faster (report builder)

    That still makes a case for using stored procs. SQL Server caches plans for ad-hoc sql. I just creates and caches one for every distinct version. So, executing the same...

  • RE: Which one is faster (report builder)

    One caveat... SQL Server will create a reusable execution plan for the stored procedure but will treat the "text" code as ad-hoc and will need to create a new plan...

  • RE: Need help with a simple query from a one to many table relation.

    Deleted... Basically said the same thing as Drew...

    Note to self: Click the next page button BEFORE posting...

  • RE: Performance tuning of query for PDW

    Jeff Moden (10/7/2015)


    Jason A. Long (10/7/2015)


    Jeff Moden (9/6/2015)


    Grant Fritchey (9/6/2015)


    Jeff Moden (9/6/2015)


    Grant Fritchey (9/6/2015)


    You've shown very simplistic queries that are hitting entire data sets. Your tuning opportunities here are limited...

  • RE: Performance tuning of query for PDW

    Jeff Moden (9/6/2015)


    Grant Fritchey (9/6/2015)


    Jeff Moden (9/6/2015)


    Grant Fritchey (9/6/2015)


    You've shown very simplistic queries that are hitting entire data sets. Your tuning opportunities here are limited to what you can do...

  • RE: what's wrong with my insert with cte?

    Put the INSERT statement below the CTE.

  • RE: Build search condition dynamic

    mxy (10/6/2015)


    thanks but optional parameters are choose by user we need to build where clause based on user selection for each report

    You haven't told us how you plan to have...

  • RE: Build search condition dynamic

    Sounds like you may be talking about optional parameters...

    DECLARE

    @BusinessEntityID INT = NULL,

    @FirstName VARCHAR(50) = 'John',

    @LastName VARCHAR(50) = NULL;

    SELECT

    p.BusinessEntityID,

    p.PersonType,

    p.NameStyle,

    p.Title,

    p.FirstName,

    p.MiddleName,

    p.LastName

    FROM

    Person.Person p

    WHERE

    (p.BusinessEntityID = @BusinessEntityID OR @BusinessEntityID IS NULL)

    AND (p.FirstName = @FirstName...

  • RE: Assign value to variable

    This is the part that's failing...

    set @Wkstr+@i=dateadd(Wk, datediff(Wk, 6, getdate()), -@a)

    set @Wkend+@i=dateadd(Wk, datediff(Wk, 6, getdate()), -@b)

    You can't set the sum of two variables like that...

    It's not really clear what...

Viewing 15 posts - 991 through 1,005 (of 1,246 total)