Viewing 15 posts - 706 through 720 (of 1,473 total)
The good thing about the above example is most of the pieces are derived tables that can be run individually so you can see what they're doing.
This relies...
September 10, 2009 at 9:13 am
It was, sorry, I missed a section when I copy/pasted. It's there now.
September 10, 2009 at 9:09 am
I added an integer field named PairID to your data, each pair increments the int by 1. Here is some code to generate that result set. This wasn't...
September 10, 2009 at 8:58 am
Much better, thank you.
Now, before I make this thing needlessly complex, is there anything that can link an Orig value to a New Value beyond the fact that they're sequential?...
September 10, 2009 at 8:21 am
SELECT CAST(5 AS DECIMAL(9,2))
SELECT CAST(3.2 AS DECIMAL(9,2))
September 10, 2009 at 8:10 am
Ugh, having so many issues posting lately. I wonder if it's just me.
September 9, 2009 at 11:43 pm
Not real familiar with openrowset, but ordinarily in a situation like this I'd sugest dynamic sql to solve this issue.
Something like:
declare @sql varchar(500),
@path varchar(50),
@sheet varchar(50)
set @path...
September 9, 2009 at 11:43 pm
Please see the link in my signature about how to post sample data.
I'm making many assumptions here, but you could possibly do something along the lines of
SELECT 'Table1' TableName, Field1,...
September 9, 2009 at 11:32 pm
New2SQL (9/9/2009)
Declare @table1 as Table(cID bigint,Uid bigint)
insert into @table1 select 23,40
insert into @table1 select 20,50
insert into @table1 select 23,60
declare @groupid nvarchar(10)
set @groupid = '40,50'
declare @sql nvarchar(1000)
set @sql...
September 9, 2009 at 11:07 pm
Jeff Moden (9/9/2009)
SELECT e.*
FROM dbo.Employees e
INNER JOIN dbo.Students s
ON e.Name = s.Name
AND e.Age...
September 9, 2009 at 9:05 pm
Yeah, Tally table is a viable option here.
Here's a couple hints to get you started.
SELECT DATEADD(mm,N,StartDate)
WHERE DATEADD(mm,N,StartDate) < EndDate
September 9, 2009 at 9:03 pm
It depends on how exactly you need the output. If you just need to see if a date is between the start and end date, it's a simple check....
September 9, 2009 at 8:10 pm
[Edit] Read that a bit too quickly the first time.
The way you are doing it should work. Perhaps if you share your end goal, we can come up...
September 9, 2009 at 7:48 pm
My guess is that writing your query to use correlated subqueries in that fashion is going to be obnoxiously slow.
You might consider restructuring that query to be something like this:
SELECT...
September 9, 2009 at 7:44 pm
You can insert the results into a table and then work with the table.
CREATE TABLE x(
the fields and datatypes your sp returns...
)
INSERT INTO x(fields)
EXEC getservicecontractsinfo 'ALL', '2009-09-01', '2009-09-30'
SELECT ...
FROM x
WHERE...
September 8, 2009 at 10:32 am
Viewing 15 posts - 706 through 720 (of 1,473 total)