Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sishan81
Starting Member
7 Posts |
Posted - 2010-07-20 : 06:58:44
|
| Hi,I used sp_executesql for dynamic sql.Now I want to insert the results into an existing table by using:insert into ExistingTableEXEC sp_executesql @Sql2.But,I keep getting an error: Caution: Changing any part of an object name could break scripts and stored procedures.Msg 8114, Level 16, State 1, Line 1Error converting data type varchar to numeric.Why?What does it mean? |
|
|
sql-programmers
Posting Yak Master
190 Posts |
Posted - 2010-07-20 : 07:09:20
|
| Check the result columns type from EXEC sp_executesql @Sql2 and the ExistingTable's data type. There may be a datatype mismatch.SQL Server Programmers and Consultantshttp://www.sql-programmers.com/ |
 |
|
|
sishan81
Starting Member
7 Posts |
Posted - 2010-07-20 : 07:14:30
|
| I defined part as numeric and part as char,no? Set @Sql2='select '' '','' '','' '','' '','' '','' '','' '','' '',cast(0 as numeric),cast(0 as numeric),cast(0 as numeric),cast(0 as numeric),cast(0 as numeric),cast(0 as numeric) from CMP_tempopentr' |
 |
|
|
sql-programmers
Posting Yak Master
190 Posts |
Posted - 2010-07-20 : 07:24:51
|
| Can you provide the ExistingTable's structureSQL Server Programmers and Consultantshttp://www.sql-programmers.com/ |
 |
|
|
sishan81
Starting Member
7 Posts |
Posted - 2010-07-20 : 09:43:47
|
| Found one mismatch I didn't notice before. Thanks! you helped me a lot!! |
 |
|
|
|
|
|
|
|