August 14, 2012 at 9:23 am
I want to script SQL Server objects programmatically [say, delete (DROP) all FKs, then change keys, and restore (CREATE) FKs] with SMO Scripter class.
I found an article on the Web, but...
Please see the attached image and help me to compile ~20 line long C# program.
Thanks.
PS: I am not exactly 'Rookie' but SQL Server is just one of my development environments.
August 14, 2012 at 10:24 am
you need to instantiate the Urn[] collection before attempting to use it.
Revise the following
StringCollection sc = scripter.Script(new Urn[] {db.Urn });
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
August 14, 2012 at 11:23 am
In my understsnding of the quoted code it means (shortly) the following:
What's wrong with omelette instantiation?
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply