Showing posts with label advice. Show all posts
Showing posts with label advice. Show all posts

Tuesday, March 20, 2012

BOL Package example Errors

Hi There

Ok i realize this may not be exactly the correct place to post this, but i seem to get good advice here.

I am trying to follow the SMO Tables DBCC Package Sample in BOL.

I have copied the Microsoft.SqlServer.Smo.dll and Microsoft.SqlServer.SmoEnum.dll to my latest .NET Framework folder as specified in BOL example.

Problem is when i try to run the package i get the following error:

An error occured while compiling the script for the Script Task

Error 30466: Namespace or type specified in the Imports 'Microsoft.SqlServer.Management.Common' cannot be found. Make sure the name space or the type is defined and it doesn't contain other aliases.
Line 9 Column 9 through 45

Imports Microsoft.SqlServer.Management.Common

Now i am guessing it has something to do with the SqlSmo dll's , i am not sure what to check as i have copied them to my .NET framework.

Someone suggested i should go to my .NET Framework 2.0 configuration and confirm that it has picked up the new smo dll's, but since installing the Beta .Net Framework 2.0 from the June CTP i get the following error when i try open the configuration:

Snap-in failed in to initialize
.NET Framework 2.0 Configuration

I have tried reinstalling the .Net Framework and i still get the same error, have not found any appropriate solutions on the net.

Are these issues related ? Any help would be greatly appreaciated.

Thanx
I'm not familiar with that sample. Where are you trying to use the SMO assemblies? In the script task?|||Hi Kirk

That is correct.

If you have installed the sample packages in the default directory.
You can open the project from the following path:

C:\Program Files\Microsoft SQL Server\90\Samples\Integration Services\Package Samples\SmoTablesDBCC\SmoTablesDBCC\SmoTablesDBCC.dtproj

If you have not installed tthe sample packages i can copy the script and post it here if you like.

Thanx|||Sounds like you haven't moved over the assembly.
I describe how to do that here:
http://sqljunkies.com/WebLog/knight_reign/archive/2005/07/07/16018.aspx

Thanks,|||Hi Kirk

Ok please bear with me but i have a few questions.

Firstly here are the assembly imports as they are in the script.

Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Management.Common ***
Imports Microsoft.SqlServer.Management.Smo

The one marked *** is the one with the compilation error.
Now for the example package i copied the Microsoft.SqlServer.SmoEnum.dll and Microsoft.SqlServer.Smo.dll assemblies to %windir%\Microsoft.net\framework\v2.0.xxxxx\ as specified. Now these refer to the import following the one giving me the error.So question number 1 what is the correct assembly for Imports Microsoft.SqlServer.Management.Common? As i can find no Management.Common assembly on the CTP assemblies folder? In other words i am not sure which assembly goes with that import.
Secondly I cannot find the option Project - Add References in BI studio from the project menu or an option like that in the script task editor, i have feeling i am being pretty stupid here, but i cannot, maybe it was another CTP release and it has another name in the June release?

Thanx Again Kirk|||Apologies, I assumed that the assemblies were correctly listed. The correct assembly for that namespace is actually: Microsoft.SQLServer.ConnectionInfo.dll
HTH|||Hi Kirk

Thank You it works now, i wonder why there is no mention of that assemly in the package examples in BOL? As it does nto work without it.
Lastly if you dont mind why did i not have to add a reference to it in BI, as stipulated in your link? As i mentioned above i cannot find this option in BI stdio?

Thanx Again|||Sean,
The documentation team are encouraging people to use the "Send Feedback" link in BOL if you've any problems with it. Drop them a line on that and it'll get actioned.

-Jamie|||

Lastly if you dont mind why did i not have to add a reference to it in BI?
Not clear on the question but will venture an answer.
You did add it in the VSA environment, right? The VSA environment is a sub-environment that is agnostic to and ignorant of the fact that it's running inside the BI environment. So, the VSA script can reference the assembly without the BI environment even knowing about it. I think that's the answer to the question...

|||

The information in the Readme for this sample explains some of the issues discussed in this thread.

The Script task project already contains the necessary References for all the managed namespaces that are also imported by using Imports statements. However certain DLLs need to be copied to the .NET directory as described in the Readme to be "visible" to the Script task.

You need to make the Project Explorer window visible to view and add References.

After copying the DLLs, you may need to close and reopen the script for the blue squigglies under the imported namespaces to disappear. If that doesn't work, try setting Precompile to False temporarily.

-Doug

|||Hi Kirk

That does clear things up, i found it in the VSA environment, bit unclear in the link i was trying to find it in BI, Thanxsql

Friday, February 10, 2012

Bit of help with a small project i have

hi, im basically looking some advice here for a small project we have.
basically im looking at automating an attendance register
in short want i want to do i build a matrix of students attendance on a
course. this table of data will then be used to populate a Datagrid. Course
Duration can vary but i will only ever report on the attendance for any one
course at a time. basically i will pass in the courseID as a parameter to
return the attendance for all the students on that course
what all would i need?
tbl_Students.(StudID, Name)
tbl_Course (CourseID, CourseDesc, CourseDuration)
tbl_Attendance(ID, StudID, CourseID, WNum, Attended)
what im thinking is that i will need a record for each student for each w
the course runs
im getting a bit stuck on how i would return the records in the way i want
Student Name W1, W2 etc......
Craig G 1 0 1 1 1 1 1
Jim B 1 0 0 1 1 1 1
Sam A 0 1 1 1 1 1 1
basically i would like my output to be as above where each W is a column
in a temp_table. and the 1 & 0 simply represent whether they attended or not
This may not be the best way to do it, its only the early stages of the
project so i am open to an ideas on how you would go about it
Cheers for the help,
CraigCross tabulations are best done using a report writer or a client tier
programming language. To get this done as a resultset, refer to:
http://support.microsoft.com/?scid=kb;EN-US;q175574
Anith|||On Tue, 22 Feb 2005 21:28:14 -0000, Craig G wrote:

>hi, im basically looking some advice here for a small project we have.
>basically im looking at automating an attendance register
(snip)
>This may not be the best way to do it, its only the early stages of the
>project so i am open to an ideas on how you would go about it
Hi Craig,
For the cross-tab query, check out the link Anith posted. But since
you're in the early stages of the project, allow me to post some
comments on your table design.

>what all would i need?
>tbl_Students.(StudID, Name)
Rename this table to "Students". No need to use the "tbl_" prefix; if
the name is in a FROM clause, you'll know it's a table anyway.
See if you can find a better key for students - something that can be
verified in the real world. The student's SSN would be ideal; you can
also check the school administration to find out if they have some
registration number.

>tbl_Course (CourseID, CourseDesc, CourseDuration)
The tbl_ prefix on this one should go as well. Most people prefer plural
names for tables, except for tables that hold only one row, so consider
renaming to "Courses".
Doesn't your school use mnemonic abbreviations for courses? These are
often an ideal candidate for primary keys: they are short enough, they
are easy verifiable and they are already in use and known.

>tbl_Attendance(ID, StudID, CourseID, WNum, Attended)
WNum? What will you do after december? If you start using w 1
again, you'll get duplicate data. I think you should add year as well,
or you should use a datetime column holding the first day of the w
(that way, you'll have date and year in the same column, the downside is
that you have to do some calculations to extract w number).
I don't think you need a seperate ID column in this table. Just use the
compound primary key on StudID, CourseID, WNum and Year.
Get rid of the Attended column. Only record the students that attend a
course. If there's no row for a student in a specific w, (s)he did
not attend the course.
I also think you're missing a table. It seems logical that students
enlist for some courses, probably picking a starting w. So you also
need a table
Enlistments (StudID, CourseID, StartW, StartYear)
With (StudID, CourseID) the primary key. StudID and CourseID are each a
foreign key to Students resp. Courses. And the combination (StudID,
CourseID) in Attendance will be a foreign key to Enlistments.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||I can't believe you are telling someone to use a user editable field as a
key. You need to do a little research on database design before you start
telling people how to screw up their design. Don't you know that SSN's can
be mistyped? Proper PK's should have NO real world meaning.
JIM
"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:ke9r115eavtte6r7hjgpt6i14vjb5a3vke@.
4ax.com...
> On Tue, 22 Feb 2005 21:28:14 -0000, Craig G wrote:
>
> (snip)
> Hi Craig,
> For the cross-tab query, check out the link Anith posted. But since
> you're in the early stages of the project, allow me to post some
> comments on your table design.
>
> Rename this table to "Students". No need to use the "tbl_" prefix; if
> the name is in a FROM clause, you'll know it's a table anyway.
> See if you can find a better key for students - something that can be
> verified in the real world. The student's SSN would be ideal; you can
> also check the school administration to find out if they have some
> registration number.
>
> The tbl_ prefix on this one should go as well. Most people prefer plural
> names for tables, except for tables that hold only one row, so consider
> renaming to "Courses".
> Doesn't your school use mnemonic abbreviations for courses? These are
> often an ideal candidate for primary keys: they are short enough, they
> are easy verifiable and they are already in use and known.
>
> WNum? What will you do after december? If you start using w 1
> again, you'll get duplicate data. I think you should add year as well,
> or you should use a datetime column holding the first day of the w
> (that way, you'll have date and year in the same column, the downside is
> that you have to do some calculations to extract w number).
> I don't think you need a seperate ID column in this table. Just use the
> compound primary key on StudID, CourseID, WNum and Year.
> Get rid of the Attended column. Only record the students that attend a
> course. If there's no row for a student in a specific w, (s)he did
> not attend the course.
>
> I also think you're missing a table. It seems logical that students
> enlist for some courses, probably picking a starting w. So you also
> need a table
> Enlistments (StudID, CourseID, StartW, StartYear)
> With (StudID, CourseID) the primary key. StudID and CourseID are each a
> foreign key to Students resp. Courses. And the combination (StudID,
> CourseID) in Attendance will be a foreign key to Enlistments.
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)