I have to transport some tables(16 tables) to another database and there are a number of stored procedures(200 tables) which use these tables.
Transporting stored procedures to another database is not preferred.
For my case:
dbA contains sp_xyz stored procedure, tableB and tableC tables.
and content of sp_xyz can be :
SELECT A.column1, B.column2
FROM
tableB A
JOIN tableC B ON A.fk_b_id = B.id
we want to transport tableC to dbB. So how should I change this sp with minimum change.
sp_as a prefix for stored procedures in SQL Server. It's reserved for Microsofts use (it stands for "system procedure", not stored procedure), and they're slower to access than other names (becausemasteris searched before the current database). In general, you shouldn't need to use prefixes for objects in SQL - just the position of an object in a query or statement should inform you on what type of object it is (exception: tables and views - but they should be interchangable anyway)