Viewing 15 posts - 18,751 through 18,765 (of 18,923 total)
Here's an example from my Punch table
SELECT FkEmploye, DateDebut, DATEDIFF(hh, DateDebut,
...
December 15, 2004 at 2:45 pm
All my method does is generate new random numbers everytime the query is run. But if you run this query as a subquery then it is run 1 time...
December 15, 2004 at 1:03 pm
Wouldn't this be simpler (assuming each combinaison is unique)?
Select UserID from MyTable where RoleID in (1, 2, 3) Group by UserID having count(*) = 3
December 15, 2004 at 8:07 am
Just a variation on mkeast's answer (so you get all tables) :
SELECT O.Name, Sum(C.length) as MaxDataBytes
FROM dbo.sysobjects O JOIN dbo.syscolumns C ON O.id = C.id
where O.XType = 'U' and...
December 15, 2004 at 6:36 am
I don't have a script that does that. But one thing you could do if this is a one time shot is to script out the table in QA....
December 14, 2004 at 2:56 pm
Here's an idea...
CREATE TABLE [Numbers] (
[PkNumber] [int] IDENTITY (1, 1) NOT NULL ,
CONSTRAINT [Pk_Number] PRIMARY KEY CLUSTERED
(
[PkNumber]
) ON [PRIMARY]
) ON [PRIMARY]
GO
Declare @i as int
set @i = 0
while @i < 8000...
December 14, 2004 at 1:52 pm
David, this is extactly why I am wondering about the strings. I have a search sp that can be ordered by pretty much any field and always asc or...
December 14, 2004 at 8:04 am
Nice shortcut. Is there a similar trick to sort dates and strings dynamically?
December 14, 2004 at 7:11 am
Then you can tweek the first query I posted, it should give you what you need.
December 13, 2004 at 1:53 pm
That's not possible. A column name must be unique to a table.
The code I gave you scans ALL the columns from all the tables for duplicate field name (excluding...
December 13, 2004 at 12:12 pm
Hmm. Why exactly do you need to do this?? I'm currently rebuilding an application and every single little structure modification takes hours/weeks to implement. Something like this that...
December 13, 2004 at 11:20 am
Holds true for all objects Frank... But even more for RecordSets.
December 13, 2004 at 7:14 am
I think that would solve the problem (just make sure that the derived table dtOrderedSales has the order by you need and you should be fine) :
SELECT identity (int,...
December 10, 2004 at 11:15 pm
Actually if you only want ONLY positive values you'd be better off doing something like this :
Select ABS(MyCol) from dbo.MyTable
December 10, 2004 at 6:44 am
Viewing 15 posts - 18,751 through 18,765 (of 18,923 total)