Viewing 15 posts - 46 through 60 (of 93 total)
This is really hard to debug without actual data and table structure, and I can't guarantee this will work, but try replacing the Max( Case (Cast(Sbm.Enddatetime).... with the following...
CASE
WHEN Sbm.Enddatetime...
March 9, 2007 at 6:46 am
Oh! I was trying to do something like this before, but I hadn't given the derived table an alias and I was getting errors. I just thought this wasn't possible. ...
March 1, 2007 at 10:19 am
I knew I was making it more difficult than it had to be by generating SQL scripts and considering using BCP. Thanks very...
February 15, 2007 at 2:38 pm
Thanks so much! Had no idea you could insert rows into a table like that. This is a development server, so I'm not too worried about the performance. I'll just do...
February 15, 2007 at 9:21 am
I can't help but agree. All of us that answered D before the question got fixed should be credited with the correct answer.
December 12, 2006 at 5:44 am
Just wanted to elaborate further on my earlier Beyond Compare post since most of you use SQLCompare from what I can tell. I did take a look at Red-Gate's website and noticed that all...
October 6, 2006 at 12:49 pm
The tool that immediately comes to mind for me is Beyond Compare. It's one of the best comparison softwares I've seen as it lets you realign code if the compare...
October 6, 2006 at 5:52 am
Try like this:
Declare @BeginDate varchar(8)
Declare @EndDate varchar(8)
Select @BeginDate = convert(varchar,DateAdd(mm, DateDiff(mm, 0, dateadd(mm, -2, Getdate())),0),112)
Select @EndDate = convert(varchar,DateAdd(mm, DateDiff(mm, 0, dateadd(mm, -1, Getdate())),0),112)
Then you can use @BeginDate and @EndDate wherever...
July 31, 2006 at 2:36 pm
As far as explicitly goes, you can wrap your int with quotes, but that's probably not the best solution. Or cast your ints to varchars and then compare. I don't...
July 20, 2006 at 1:49 pm
It looks like the problem is in the Insert on your temporary table. You are probably inserting multiple rows for each UserId instead of updating an existing row. You might...
July 6, 2006 at 10:02 am
Dainis,
You posted in the forum "Anything that is NOT about SQL!" "NOT" being the keyword. You might try posting this over at Reporting...
July 5, 2006 at 1:47 pm
exec ('[' + @server + '].[' + @db + '].[dbo].spu_procedure ' + @remoteserver + ' = ' + @localServer + ' output')
July 5, 2006 at 1:36 pm
I would probably use a query similar to this:
SELECT *
FROM [Table]
WHERE [Column] = ( SELECT MAX([Column]) FROM [Table] )
July 5, 2006 at 1:14 pm
Never mind. I did get it on my own. The following query is the one I'll be using:
UPDATE D
SET LicenseStateDifferent = 'Y'
FROM...
July 5, 2006 at 7:03 am
Looks like the only thing I need to do differently on the query is only update the rows that will have LicenseStateDifferent = 'Y'. The field is originally defaulted to...
July 5, 2006 at 6:57 am
Viewing 15 posts - 46 through 60 (of 93 total)