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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 dynamic sql

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-01-13 : 08:36:07
Katarina writes "Hi there,

does anyone know what's wrong with this code:

declare @SQLString nvarchar(100)
declare @tablename varchar(100)

set @tablename = 'quelquechose'

set @SQLString = N'IF OBJECTPROPERTY ( object_id('+@tablename+'),'ISTABLE') = 1 DROP TABLE '+@tablename

execute sp_executesql @SQLString

Thanx!
Katarina"

setbasedisthetruepath
Used SQL Salesman

992 Posts

Posted - 2003-01-13 : 13:58:06
Increase the length in your variable definitions. Try 1000 instead of 100, for example.

Jonathan
{0}
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-01-13 : 14:05:47
What is the error that you are getting?

Go to Top of Page
   

- Advertisement -