Sp_rename 
Author Message
 Sp_rename
Hi everybody,
  I am trying to rename a table dynamically...i tried
various way, i was still not succefully.

Could anyboyd pl. help me out on this...










Thanks
Jenniffer



Fri, 06 Jan 2006 15:59:32 GMT
 Sp_rename

Hi everybody,
  I am trying to rename a table dynamically...i tried
various way, i was still not succefully.

Could anyboyd pl. help me out on this...










Thanks
Jenniffer



Fri, 06 Jan 2006 15:59:37 GMT
 Sp_rename
You don't need dynamic SQL because sp_rename allows the use of a variable as
a parameter anyway. There is no TRIM() function in SQL, use LTRIM/RTRIM,
though in this example it's redundant.






--
David Portas
------------
Please reply only to the newsgroup
--



Fri, 06 Jan 2006 16:11:50 GMT
 Sp_rename
You had a few syntax errors in your code...

There is no trim function in SQL server... only ltrim and rtrim....

Try this:

create table test1
(id int)




insert into test1 values(1)
insert into test1 values(2)

select id_from_test1 = id from test1





select id_from_test2 = id from test2

--drop table test1
drop table test2

--
Dean Savovic
www.teched.hr

Quote:

> Hi everybody,
>   I am trying to rename a table dynamically...i tried
> various way, i was still not succefully.

> Could anyboyd pl. help me out on this...










> Thanks
> Jenniffer



Fri, 06 Jan 2006 16:12:41 GMT
 Sp_rename

Thanks a lot ...

thats works

Quote:
>-----Original Message-----
>You don't need dynamic SQL because sp_rename allows the

use of a variable as
Quote:
>a parameter anyway. There is no TRIM() function in SQL,
use LTRIM/RTRIM,
>though in this example it's redundant.





(1))))

>--
>David Portas
>------------
>Please reply only to the newsgroup
>--

>.



Fri, 06 Jan 2006 16:29:42 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. DTS/sp_rename bug

2. Locks on a DTS data-pump task blocking a stored procedue (sp_rename)

3. sp_renames in a transaction

4. sp_rename

5. sp_rename on an indexed column

6. HOW TO USE SP_RENAME IN SQL2000

7. replication and procedure sp_rename

8. Using sp_rename on a stored procedure

9. transaction in sp_rename

10. sp_rename in Enterprise Manager

11. SQL Server 6.5 (6.50.479) & sp_rename

12. sp_rename: A bad thing???


 
Powered by phpBB® Forum Software