Forum Replies Created

Viewing 9 posts - 1,306 through 1,314 (of 1,314 total)

  • RE: Dealing with ' and " in strings

    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...

  • RE: Output result set to a .CSV file with TSQL

    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...

  • RE: Not so Random Cursor!

    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...

  • RE: Hard disk space for a table

    Oops, make that a LEFT JOIN.

    And if you only want table sizes (or only one row per table), remove subquery B.

  • RE: Hard disk space for a table

    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...

  • RE: QOD 30/07/2003 - Another Documentation Error???

    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...

  • RE: Estimating the size of a table with a clustered in

    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...

  • RE: Doing Short Circuiting in WHERE clause

    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...

  • RE: Doing Short Circuiting in WHERE clause

    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...

Viewing 9 posts - 1,306 through 1,314 (of 1,314 total)