Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-10-04 : 07:45:13
|
Priya writes "i am getting this error while running my sql script.Invalid object name 'dbo.'+@TName+''." |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-10-04 : 09:07:30
|
quote: Originally posted by AskSQLTeam Priya writes "i am getting this error while running my sql script.Invalid object name 'dbo.'+@TName+''."
Without posting the query you used, it is hard to answerMadhivananFailing to plan is Planning to fail |
|
|
X002548
Not Just a Number
15586 Posts |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-10-04 : 10:09:14
|
You need to look at the bigger picture. Like this :
'dbo.'+@TName+''." It's is clear that there is an extra single quote after the @TName. And why it is end with a double quote ?'dbo.'+@TName+'.' KH |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-10-04 : 10:42:24
|
Even after escaping single quote with two quotes, it doesn't make sense. Why, use of quote at all? why not something like this:'dbo.' + @tname + '.' Harsh AthalyeIndia."Nothing is Impossible" |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2006-10-04 : 10:43:47
|
Why are you passing a table name as a variable anyways? ... lets see...NORMALIZEFORMAT IN FRONT ENDLEARN SQLdid that cover the possibilities?[Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQLhttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-10-04 : 10:54:36
|
quote: Originally posted by DonAtWork Why are you passing a table name as a variable anyways? ... lets see...NORMALIZEFORMAT IN FRONT ENDLEARN SQLdid that cover the possibilities?[Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQLhttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp
Yes. They will MadhivananFailing to plan is Planning to fail |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-10-04 : 11:22:13
|
quote: Originally posted by DonAtWork Why are you passing a table name as a variable anyways? ... lets see...NORMALIZEFORMAT IN FRONT ENDLEARN SQLdid that cover the possibilities?[Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQLhttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp
Add one more - WHY DYNAMIC SQL ? KH |
|
|
|