sql - Creating SP specific to a database? -


every time create stored procedure defaulting "master" database. how make sp specific database "uploads"?

create procedure testinsert2 insert [uploads].dbo.[aspnet_uploads] (userid, filename, username) values  ('test1', 'test2', 'test3') 

you need in context of database.

use uploads; go create procedure dbo.testinsert2 begin     set nocount on;      insert dbo.[aspnet_uploads](userid, filename, username)       values('test1', 'test2', 'test3'); end go 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -