Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)

  • RE: Can all permissions to Public role be safely removed?

    Here's an article from the well-respected Andy Warren that proposes a security management solution that includes removing all permissions from the PUBLIC role:

    http://www.sqlservercentral.com/columnists/awarren/sqlpermissionspublicrole.asp

  • RE: Best way to remove a character in a field...

    a 'where' clause can not be used with a 'SET' statement, in your example, change the 'SET' to a 'SELECT' as follows:

    declare @string char(32)

    set @string = 'abxcxefg'

    select @string = replace(@string,'x','')

    where...

  • RE: Delete a header row from a text file?

    I should have noted that using the Bulk Insert approach involves the use of a "raw data" staging table with a single character field of length equal to the fixed record...

  • RE: Delete a header row from a text file?

    Bulk Insert with a FirstRow argument of 2 would work, as it does not make inaccurate assumptions like DTS does based on the characteristics of the first line of data.

    E.G.

    BULK INSERT table_name FROM...

  • RE: Remove alpha characters

    Jonathan,

    I agree about using 'STUFF' - in fact, when I went back to my code to copy it into my message, I realized that I had used 'STUFF', rather than...

  • RE: Remove alpha characters

    Yes, and here are my test cases. Note that if you reverse the ordering of the second case the results are reversed - revealing the obvious ... that character distribution...

  • RE: Remove alpha characters

    For long strings with more than a small percentage of characters that must be stripped, the overhead of the PATINDEX and STUFF functions will degrade performance.

    For these cases, a substantial...

  • RE: Bulk Insert from CSV problem

    Re: data type conversion issues

    Another approach to consider when importing data into SQL Server is to use a staging table with all varchar fields to hold the raw data. This...

  • RE: top 10 zipcodes

    If your table has a primary key, say pkey, then the following set-based solution will get the first 10 records for each zipcode ordered by the primary key:

    select *

    fromzip z1

    wherepkey...

  • RE: Key Items

    If you only need to keep the first record from a set of duplicates, you might want to create a unique index on the logical primary key fields with the...

Viewing 10 posts - 1 through 10 (of 10 total)