Viewing 15 posts - 331 through 345 (of 1,182 total)
DB Dan (4/15/2011)
Try the following
SELECT t2.EntityID, t1.EntityID
FROM @NewEntities t1
CROSS JOIN @NewEntities t2
WHERE t1.ID < t2.ID
ORDER BY t2.ID DESC
Dang-It Dan!!!!
That was TOO EASY. I was going down a rabbit hole...
April 15, 2011 at 7:53 am
Goldie Lesser (4/15/2011)
.............
For example, I start with a list of entities: 32, 54, 67, 148.
I would need to insert the following values into the enemies table.
OriginalID | EnemyID
148 | 54
148...
April 15, 2011 at 6:53 am
Koen Verbeeck (4/14/2011)
fname lname-1111520 (4/13/2011)
I get it: "then", "than", "there's", "there are". Stop reading (and I did), it can't be coherent.
Oink? You stop reading a technical article...
April 14, 2011 at 6:38 am
http://www.red-gate.com/products/
These tools are the best! They've saved me so much time over the years it's not even funny. And before you ask, I don't work for them. 🙂
April 12, 2011 at 6:44 pm
Are you going to want reapply those constraints? Because you won't be able to, and your data will all kinds of mixed up. Unless you know there isn't a possibility...
April 12, 2011 at 6:34 pm
With respect to #1:
1. Hone your SQL skills on 2000, and I mean really nail them down. Understanding set based theory at more than a "I can write SQL, and...
April 12, 2011 at 2:20 pm
Daniel Bowlin (4/12/2011)
What I would try is to have only one...
April 12, 2011 at 1:45 pm
Mr Corn Man (4/12/2011)
April 12, 2011 at 1:13 pm
I may be missing something obvious here, but the name of the table comes from sys.tables, and that's NVARCHAR, not VARCHAR. Regardless of what your tables are named an NVARCHAR...
April 12, 2011 at 12:26 pm
Mr Corn Man (4/12/2011)
Also, the table has ~6M rows in it, so I can't really input the data the...
April 12, 2011 at 12:19 pm
normanshongo2003 (4/12/2011)
from Employees
where Department_No='90'
this will show the monthly salary but when i put in ,2 it wont do two decimal places?
ive used the round function...
April 12, 2011 at 7:37 am
Help us help you!
Why not give us some sample data? Ideally, the data that is returning in the unwanted format, and the exact code you're running.
April 12, 2011 at 7:06 am
You can't use the variable @DBname in your query like that. You'll need to use dynamic SQL. 😀
April 12, 2011 at 7:00 am
Pink123 (4/11/2011)
It sjust
insert into #temptable
select ....
from ...
then I do a select rownumber as mentioned in my query and it gives rowcount as...
April 11, 2011 at 2:38 pm
How about .....
declare @t table (PHONE_NBR varchar(12), CALL_DATE datetime)
insert @t
select '3215551234','04/10/11' union all
select '3215551234', '04/11/11' union all
select '3215551234', '04/11/11' union all
select '3215551234', '04/14/11' union all
select '3215551234'...
April 11, 2011 at 2:12 pm
Viewing 15 posts - 331 through 345 (of 1,182 total)