Viewing 9 posts - 1,306 through 1,314 (of 1,314 total)
Replace any apostrophe (') in the input with two apostrophes and stick with ' for your string delimiter. Or if you like to use quotes (") for the string...
July 30, 2003 at 4:52 pm
You can run BCP from TSQL with xp_cmdshell:
exec master.dbo.xp_cmdshell 'bcp "<query>" queryout <path1>\<csvfile.ext> -n -S<server> -T -o <path2>\<logfile.ext>'
<query> = the complete SELECT statement. If it is a large query...
July 30, 2003 at 4:33 pm
NEWID() is random enough, although I can't find any documentation on how "random" it is for statistical sampling. I have run some tests and haven't been able to find...
July 30, 2003 at 2:07 pm
Oops, make that a LEFT JOIN.
And if you only want table sizes (or only one row per table), remove subquery B.
July 30, 2003 at 1:50 pm
I came up with this script (based on sp_spaceused) to show the size of tables and their indexes. If you haven't run DBCC UPDATEUSAGE, some of the numbers won't...
July 30, 2003 at 1:46 pm
Ditto to cholliet, the question said the OS was "Windows 2000 Standard Edition". Since they did not include the word "Server", I assumed they meant W2K Pro. (Which is...
July 30, 2003 at 1:32 pm
A clustered index only requires space for the b-tree rows, as the leaf rows are stored in the table itself. Extra index fields add to the size of each...
July 29, 2003 at 5:23 pm
I like jpipes' solution. Even though it beat my repsonse by half an hour, I hadn't seen it before I started writing.
The only problem is the number of variations...
July 29, 2003 at 3:30 pm
Don't do it in a stored procedure!
To begin with, using CASE or ISNULL functions can prevent index optimizations and force index or table scans in any query. But if...
July 29, 2003 at 1:56 pm
Viewing 9 posts - 1,306 through 1,314 (of 1,314 total)