Viewing 15 posts - 646 through 660 (of 668 total)
I'm not really sure what you're trying to accomplish. Can you provide table scripts and inserts as well as what you've already tried? Here's a link on best...
September 30, 2009 at 7:13 am
you can try Visual Studio (need database edition) or RedGate
September 29, 2009 at 7:38 am
Not realy sure what you're looking for. Do you want to delete the data before loading? Reseeding has to do with a table that has an identity column....
September 28, 2009 at 1:11 pm
declare @vdt_date smalldatetime
set @vdt_date = getdate()
set @vdt_date = '2009-09-30'
set @vdt_date = '2009-10-01'
select @vdt_date,
case when month(@vdt_date) >= 10 then
...
September 24, 2009 at 8:54 am
select max(id) id , name, max(version) version
from versions
group by name
September 24, 2009 at 8:12 am
you can use a proc with output parameters. Then you could use some logic on the month to determine which fiscal year the date is in
September 24, 2009 at 8:07 am
You can use a CTE to accomplish this, but I think you should read the link provided by Lynn first.
September 22, 2009 at 1:37 pm
do you have any table layouts, data that you could post?
September 22, 2009 at 1:14 pm
you have to remove the criteria from the query. You can place it in a case when statement and use sum instead of count
SELECT department, sum(case when salary >...
September 15, 2009 at 7:49 am
I think I might be missing something, but it looks like all the joins are going against the QALS table, so you don't need the inner join. Couldn't you...
September 8, 2009 at 12:19 pm
There is an SSMS tool pack that you can install as an addin to SSMS. That allows you to color code each connection. You can find it here...
September 2, 2009 at 6:26 am
Once you find the max price then you can find the max date. Try this
declare @tbl table
(
sort int,
type varchar(100),
date datetime,
price decimal(12,2),
...
September 1, 2009 at 7:05 am
Here's one way, but if the source table is large could be a performance nightmare
--===== If the test tables already exist, drop
IF OBJECT_ID('TempDB..#mysourcetable','U') IS NOT NULL
...
August 31, 2009 at 1:36 pm
You can use a cte with row_number to order and get the days. Here's an example using your data
create table cust (CustomerID int, OrderID int,OrderDate smalldatetime,DaysBetweenOrders tinyint)
insert into cust...
August 25, 2009 at 1:02 pm
you can group by fields that are not in the select clause. Results won't make much sense, but sql allows this.
SELECT a,b
FROM #temp
...
August 25, 2009 at 9:22 am
Viewing 15 posts - 646 through 660 (of 668 total)