komal145 (9/25/2012)
Hi...I am getting this messageMsg 245, Level 16, State 1, Line 7
Conversion failed when converting the varchar value 'd1867 ' to data type int.
Below is my code:----
INSERT INTO TableA(
ID
)
SELECT
Title
FROM #table
please help.
With no details to work with I am going to take a guess that your column ID is an int and you want to insert all rows from #table where Title is a valid int????
INSERT INTO TableA(
ID
)
SELECT
Title
FROM #table
where Title not like '%[^0-9]%'
Jeff Moden wrote a great spackle article about this very recently. http://www.sqlservercentral.com/articles/IsNumeric/71512/[/url]
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/