Viewing 15 posts - 13,831 through 13,845 (of 14,953 total)
I created a table using your structure, then populated it with 1-million rows of random numbers between 0 and 999.
I tried a couple of different query methods:
(The table name is...
May 6, 2008 at 1:55 pm
Will the create scripts for the table accomplish what you need? That will have the definition of each column in each table.
If so, you can get those by using...
May 6, 2008 at 12:46 pm
It's pretty simple.
What you need are reservations that have a check-in date before the other reservation's check-out date, and a check-out date after the other reservation's check-in date.
select res1.resno, res1.roomno
from...
May 6, 2008 at 12:41 pm
It's not really a question of performance. Either one will be about as fast as the other. It's a question of what do you want in your database,...
May 6, 2008 at 12:35 pm
Two things:
I think the query needs to be enclosed in quotation marks.
And it might be helpful if you include what error message you're getting.
May 6, 2008 at 12:28 pm
The error means you're trying to add numeric (int) values to a string. You have to cast/convert them first.
It's when you start adding values to the list of what...
May 6, 2008 at 12:27 pm
left(string, charindex('@', string, 0)-1
will give you everything to the left of the "@"
right(string, len(string) - charindex('@', string, 0))
will give you everything to the right of the "@".
Charindex finds the position...
May 6, 2008 at 12:22 pm
It would go after the table name. Are you sure you want it? (Can result in dirty data.)
May 6, 2008 at 12:16 pm
If there's no relation between them (something like an employee ID), then there's no way to match the rows from one to the other. Is that what you're saying?
May 6, 2008 at 12:13 pm
create table dbo.Tally (
Number int identity (0,1) primary key,
Junk bit)
go
insert into dbo.Tally(junk)
select top 10001 null
from sys.all_objects
cross join sys.all_objects
go
alter table dbo.Tally
drop column junk
That should do it for you.
May 6, 2008 at 12:10 pm
SQL Server performance is primarily the result of two things: Enough hardware set up correctly, and a well-built database.
The hardware part is easy. Don't try to run an enterprise...
May 6, 2008 at 11:42 am
Put a column alias in there.
SELECT 'A' as [Table],
aID as ID,
Col,
...
May 6, 2008 at 11:30 am
The trick, if you want to name it, is don't select "SQL Server", select "Other" and then "Native SQL" as the provider. Then you can name it.
May 6, 2008 at 11:26 am
I'd start by checking the tables and indexes for fragmentation and the statistics for how recent they are.
You can do this by right-clicking these things in Management Studio and checking...
May 6, 2008 at 11:21 am
We recently had an issue with intermittent timeouts that was caused by a RAID controller that had started having problems (had a bad solder join on part of it). ...
May 6, 2008 at 11:11 am
Viewing 15 posts - 13,831 through 13,845 (of 14,953 total)