Viewing 15 posts - 8,266 through 8,280 (of 8,753 total)
ChrisM@Work (5/12/2014)
Eirikur Eiriksson (5/12/2014)
Mike Saunders NL (5/12/2014)
The only thing that is missing is that the days with no events are not mentioned. Is there a way to...
May 12, 2014 at 11:05 am
Lynn Pettis (5/12/2014)
I have no idea what you mean by a POC Index, please explain. Also, please note the changes I did make on the sample data.
The POC index...
May 12, 2014 at 10:55 am
Mike Saunders NL (5/12/2014)
The only thing that is missing is that the days with no events are not mentioned. Is there a way to display these days...
May 12, 2014 at 9:42 am
Bill Talada (5/12/2014)
Q.E.D.I added this weird line after the FROM clause and now results are immediate!
OPTION ( OPTIMIZE FOR ( @xml = NULL ) )
Good stuff!
I had forgotten about this,...
May 12, 2014 at 9:21 am
Here is a simpler window function (2012/2014) version. Although simpler than the earlier 12/14 one, it performs similar, mainly because of an sort operator which is around 60% of the...
May 12, 2014 at 9:12 am
Bill Talada (5/12/2014)
May 12, 2014 at 7:25 am
paul 31908 (5/12/2014)
I am creating a database where each record is required to have a twin record in the database.
These is a type a value and a type b...
May 12, 2014 at 6:18 am
If you are on Sql Server 2012 or 2014, you should definitely look into the over clause and the window functions, perfect for this type of work.
😎
May 12, 2014 at 6:08 am
Here is one way of doing this
😎
USE tempdb;
GO
CREATE TABLE #events
(
eventID int,
eventname char(30),
startdate date,
enddate date
)
INSERT INTO #events VALUES (1,'testevent 1','2014-05-02','2014-05-30');
INSERT INTO #events VALUES (2,'testevent...
May 12, 2014 at 5:13 am
Grant Fritchey (5/12/2014)
madhukars 32911 (5/12/2014)
Yes,I want to use JOINS, but this relationship is to be generated automatically on selection of the tables by the user.
Right. No way to do this...
May 12, 2014 at 4:53 am
madhukars 32911 (5/12/2014)
Hi,I want to use the existing relationship to be populated in a text box in vb.net
Thanks
Madhukar
Start by looking at these views in the database
[font="Courier New"]INFORMATION_SCHEMA.TABLE_CONSTRAINTS
INFORMATION_SCHEMA.DOMAIN_CONSTRAINTS
INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE
INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
INFORMATION_SCHEMA.CHECK_CONSTRAINTS
INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE[/font]
😎
May 12, 2014 at 4:34 am
madhukars 32911 (5/12/2014)
Yes,I want to use JOINS, but this relationship is to be generated automatically on selection of the tables by the user.
I don't think it is a good idea...
May 12, 2014 at 4:16 am
This is not a dynamic solution, the number of columns are set in the code.
😎
USE tempdb;
GO
DECLARE @POLHIST TABLE
(
POLICY_DETAILS_ID VARBINARY(16) NOT NULL
...
May 12, 2014 at 3:59 am
For comparison, here is a SQL 2012/2014 window function version. Without an POC index, Lynn's code is still faster.
😎
SELECT
IdCompany
,CompanyName
,CompanyCode
FROM
(
...
May 11, 2014 at 11:09 pm
Viewing 15 posts - 8,266 through 8,280 (of 8,753 total)