Viewing 15 posts - 331 through 345 (of 1,183 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...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 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...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 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...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 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. 🙂
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 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...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 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...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 12, 2011 at 2:20 pm
Daniel Bowlin (4/12/2011)
What I would try is to have only one...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 12, 2011 at 1:45 pm
Mr Corn Man (4/12/2011)
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 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...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 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...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 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...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 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.
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 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. 😀
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 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...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 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'...
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgApril 11, 2011 at 2:12 pm
Viewing 15 posts - 331 through 345 (of 1,183 total)