This execution it is giving me an error!
Any hints of what am I missing?
declare @dbname varchar(500)
set @dbname='master'
Exec ('
Use ' + @dbname + '
go
create PROCEDURE [dbo].[krijo_database] @dbname nvarchar(2000), @Direktoria varchar(4000)
AS
BEGIN
declare @stringu nvarchar(100)
set @stringu =
''CREATE DATABASE '' + @dbname
exec (@stringu)
End
')
Answear
declare @dbname varchar(500) set @dbname='kontabel'
Exec( 'Use ' + @dbname +'
Exec ('' create PROCEDURE [dbo].[krijo_database] @dbname nvarchar(2000), @Direktoria varchar(4000) AS BEGIN declare @stringu nvarchar(100) set @stringu = ''''create DATABASE '''' + @dbname exec (@stringu) End '')
')
Actually i tried like this and it worked but i i had to change quotes. The Real procedure that i would like to use it is a very big one, more dhan 50000 lines and i can't go on an changing the quotes to everything. Is there any other idea?