Question: Got a table with 1200 rows. Added a new column which will contain incremental values -
Candidate1
Candidate2
Candidate3
.
.
.
Candidate1200

What is the best way to insert these values , non manual way. I am using SQL Server 2008

Answer: 
Simple:

```
$post_title = sanitize_title_with_dashes($post_title);

```

But WordPress does this for you already. I assume you need it for something different?
I'm guessing you're sanitizing by direct SQL insertion. Instead, consider using wp\_post\_insert() in your insertion script.

```
$new_post_id = wp_insert_post(array(
  'post_title' => "This <open_tag insane title thing<b>LOL!;drop table `bobby`;"
));
```

At this point, you just worry about your title - and not the slug, post name, etc. WP will take care of the rest and (at least security) sanitization. The slug, as demonstrated in the screenshot, becomes fairly usable.

![alt text](https://i.stack.imgur.com/PgVau.jpg)

This function can be used by simply doing `include( "wp-config.php" );` and going about your business without any other PHP overhead.

If you are dealing with some funky titles to begin with, a simple strip\_tags(trim()) might do the trick. Otherwise, you've got other problems to deal with ;-)