Viewing 15 posts - 8,206 through 8,220 (of 13,469 total)
to use openrowset or openquery, adhoc would need to be enabled; if that is not possible, then linked servers, or using a login that has access to both databases would...
January 24, 2011 at 12:32 pm
I think linked servers would allow you to change authentication information, but you didn't want to do that...
The openrowset command lets you specify the connection information, you might roll both...
January 24, 2011 at 11:21 am
even worse, i believe the UPDATE() and COLUMNS_UPDATED() returns which columns were REFERENCED in the update statement, not which ones actually changed their value...since a lot of datalayers would send...
January 24, 2011 at 9:13 am
so correct me if i'm wrong, but you might want a sampling, like a random top 3 per group, right?
if that is the case, it's deceptively simple...a CTE and newid...
January 23, 2011 at 11:35 am
can you check the version of the instance you are connecting to? it might be that that instance is, say RTM, but your client tools are using SP4 or something,...
January 23, 2011 at 8:58 am
i haven't tried Azure yet, but why can't you create a permanent Tally table and use that?
January 22, 2011 at 9:03 am
Looks like the server name in @REMSServer has TWO slashes in it, the way C languages tend to escape the slashes.
can you PRINT @REMSServer and confirm the value is NYSQL004\NYSQL004...
January 21, 2011 at 12:09 pm
doh rereading based on getoffmyfoot's comments, you are definitely looking for a running total kind of solution.
January 20, 2011 at 2:11 pm
the pseudo code doesn't cut it for this one, i think. We'd need to see the actual statement you are executing, that is raising the error, so we can really...
January 20, 2011 at 1:59 pm
Horrible example, Celko; all it proves is the row used to to update the parent table is not guaranteed unless you make sure the joins form a 1:1; That's SQL...
January 13, 2011 at 11:29 am
adding the same WHERE statement for the ORDERPK to each of the CTE's might speed things up also; you be filtering to jsut the rows for the order in...
January 13, 2011 at 7:42 am
you've got a few things killing you, without the actual execution plan , these are jsut guesses:
the WHERE statement on ORDERS is not SARG-able.
instead of doing WHERE DATEADD(dd, 0, DATEDIFF(dd,...
January 13, 2011 at 7:39 am
the beautiful part about the "proprietary" update format is the ease in which you can test to see which records are matching/ would be affected.
simply inserting "--SELECT *", and highlighting...
January 12, 2011 at 4:20 pm
teh same escape method: two single quotes in a row:
For instance
Update table1
set title = 'Daddy''s Daycare'
January 12, 2011 at 11:20 am
something like this works...the important part is that two single quotes in a row is the escape sequence, so it can be contained within single quotes:
select * from yourtable where...
January 12, 2011 at 10:59 am
Viewing 15 posts - 8,206 through 8,220 (of 13,469 total)