Viewing 15 posts - 991 through 1,005 (of 1,246 total)
Phil Parkin (10/9/2015)
Jason A. Long (10/9/2015)
Phil Parkin (10/9/2015)
October 9, 2015 at 11:50 am
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...
October 9, 2015 at 11:48 am
Luis Cazares (10/9/2015)
I kept getting an error which seemed to be replicating your problem saying that the column couldn't...
October 9, 2015 at 11:45 am
Phil Parkin (10/9/2015)
October 9, 2015 at 11:42 am
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...
October 9, 2015 at 11:35 am
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...
October 9, 2015 at 10:56 am
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...
October 9, 2015 at 9:15 am
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...
October 8, 2015 at 4:29 pm
Deleted... Basically said the same thing as Drew...
Note to self: Click the next page button BEFORE posting...
October 8, 2015 at 4:12 pm
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)
October 7, 2015 at 10:01 pm
Jeff Moden (9/6/2015)
Grant Fritchey (9/6/2015)
Jeff Moden (9/6/2015)
Grant Fritchey (9/6/2015)
October 7, 2015 at 4:56 pm
Put the INSERT statement below the CTE.
October 7, 2015 at 7:42 am
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...
October 7, 2015 at 6:57 am
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...
October 6, 2015 at 6:40 pm
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...
October 6, 2015 at 9:20 am
Viewing 15 posts - 991 through 1,005 (of 1,246 total)