Viewing 15 posts - 4,036 through 4,050 (of 4,080 total)
You can use the BCP utility to execute a query and direct the output to a data file on disk.
To launch BCP from within a stored procedure, build the BCP...
October 15, 2008 at 11:20 am
It ain't pretty, but it's a start. This will run faster than doing it with a cursor or a while loop.
You'll probably need to create another cte...
October 10, 2008 at 5:34 pm
Maynor, looks like you need to PIVOT. There is another recent thread on that subject. Check it out.
October 9, 2008 at 4:15 pm
Left Joins or WHERE NOT EXISTS are the ways to go. Here's why.
I ran a little experiment using the LEFT JOIN technique versus EXCEPT. The...
October 8, 2008 at 5:22 pm
CREATE TABLE #Conditional
(
StartDate datetime,
value float,
x int
)
INSERT INTO #Conditional
VALUES ('08/10/2008 01:48', 3, 0) -- starting out with a zero value in the new "x" column
etc
--------------------------------
declare @b-2...
October 8, 2008 at 11:11 am
Jack's right. Good eye!
For what it's worth, I always use the left join format too. It's simple to remember, fast to execute, and easy...
October 8, 2008 at 10:21 am
Well, to start with the outputs are different. Exists returns a true/false value, whereas except returns a set of 0-n rows. Why would you...
October 8, 2008 at 9:38 am
This is not an optimal table design for doing what you want in SQL. It would be easier if your table was like this:
userName ...
October 8, 2008 at 9:17 am
From the looks of things, all but two of the subqueries in your WHERE clause are used only to determine if a column has a match in another table. ...
October 7, 2008 at 4:38 pm
Shame on you.
You are taking what should be three different columns and making one column out of them. Keeping date and sequence separate in your db...
October 7, 2008 at 1:43 pm
If you simply truncate a table, indexes still exist but are empty. They are reloaded when you reload the underlying table.
Yes, building or loading indexes takes work, which...
October 7, 2008 at 12:04 pm
Okay... so much for theory. I ran the code at the bottom (without DBCC FREEPROCCACHE or DBCC DROPCLEANBUFFERS) and saw no significant IO differences against the base...
October 7, 2008 at 11:50 am
My bad. I didn't catch that the middle post was also from you. I see how using "AA" without a term qualification got you where...
October 3, 2008 at 4:47 pm
Hey Craig:
By definition, in your joins, "A" only produces a set of rows for Fall 2008, just as "A2" can only return Summer 2008. As...
October 3, 2008 at 4:33 pm
I've seen it done both ways. No best answer, it really depends on whether or not there is a hard and fast rule that says if-exists-then-update/if-not-exists-then-insert. ...
October 3, 2008 at 4:10 pm
Viewing 15 posts - 4,036 through 4,050 (of 4,080 total)