Showing posts with label http. Show all posts
Showing posts with label http. Show all posts

Friday, March 23, 2012

Please give kind attension to my queries very urgent

Please give kind attension to my queries

When I am giving like http://localhost/ReportServer the following message is coming in explorer. What I have to do please help

Reporting Services Error

The version of the report server database is either in a format that is not valid, or it cannot be read. The found version is 'Unknown'. The expected version is 'C.0.8.40'. To continue, update the version of the report server database and verify access rights. (rsInvalidReportServerDatabase) Get Online Help

SQL Server Reporting Services

Moving to RS forum.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||What version of reporting services are you using and what version of sql server did you point it to?|||

Thanku for attension

I am using version SQL server 2005

|||

This thread may help.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=237706&SiteID=1

cheers,

Andrew

sql

Please explain Transaction for me

I found this on http://msdn2.microsoft.com/en-us/library/86773566.aspx which i am hoping may be able to resolve my problem but I am not sure I actually understand it.

Where it shows

// Start a local transaction.
transaction = connection.BeginTransaction("SampleTransaction");

is the "SampleTransaction" nothing more then just a name of the transaction that is being created through this code or is it actually pointing to something?

I believe that I understand the rest.

Oh and in case you have a better way of doing what I am needing here is the SQL Query that is pulling info for me to display on a page

SELECT p.product_ID, p.class_ID, p.category_ID, p.product_name, p.product_desc, p.product_image, p.product_dimension, p.product_o1, p.product_o2,
p.product_o3, p.product_ac, p.product_ph, p.product_photo, pcl.class_name, pca.category_name
FROM products AS p INNER JOIN
productClass AS pcl ON p.class_ID = pcl.class_ID INNER JOIN
productCategories AS pca ON p.category_ID = pca.category_ID

Basically I am using the transaction to perform multiple updates seeing as how I will need to update multiple tables.

privatestaticvoid ExecuteSqlTransaction(string connectionString)
{
using (SqlConnection connection =new SqlConnection(connectionString))
{
connection.Open();

SqlCommand command = connection.CreateCommand();
SqlTransaction transaction;

// Start a local transaction.
transaction = connection.BeginTransaction("SampleTransaction");

// Must assign both transaction object and connection
// to Command object for a pending local transaction
command.Connection = connection;
command.Transaction = transaction;

try
{
command.CommandText =
"Insert into Region (RegionID, RegionDescription) VALUES (100, 'Description')";
command.ExecuteNonQuery();
command.CommandText =
"Insert into Region (RegionID, RegionDescription) VALUES (101, 'Description')";
command.ExecuteNonQuery();

// Attempt to commit the transaction.
transaction.Commit();
Console.WriteLine("Both records are written to database.");
}
catch (Exception ex)
{
Console.WriteLine("Commit Exception Type: {0}", ex.GetType());
Console.WriteLine(" Message: {0}", ex.Message);

// Attempt to roll back the transaction.
try
{
transaction.Rollback();
}
catch (Exception ex2)
{
// This catch block will handle any errors that may have occurred
// on the server that would cause the rollback to fail, such as
// a closed connection.
Console.WriteLine("Rollback Exception Type: {0}", ex2.GetType());
Console.WriteLine(" Message: {0}", ex2.Message);
}
}
}
}

It's a name given to the transaction to be used in RollBack and SavePoint

SqlTransaction.Rollback (String)

Save method.

Read this inRemarksection atMSDNhttp://msdn2.microsoft.com/en-us/library/k1562zz1.aspx

sql

please correct me if I'm wrong about relational dbase setup

http://www.wowcentral.com/random/relations_example.gif
(I whipped up this little example in access really quick so I could kind of
illustrate it)
Okay, I have a dbase with info about a game and stuff.
There are races, and classes and skills etc.
Races have many classes, and classes have many skills
Now, I need to display a page about a race...and on that page, it will
display which classes are available to it.
So, you click on a class, and that will load a page about that class
describing it and what skills are available to that class.
Now, if each race only had one class, I would just make a cell on the races
table called class_id. But because each race (8 of them) will have up to 8
classes I gotta make a second table that says which classes are available to
each race.
I did this in tblRclasses.
I did the same thing for classes and skills.
Now, my friend is telling me that this is not a relational database because
the tables aren't sharring info but, like I said a second ago, if each race
only had one class, I wouldn't need the "middle man" table.
I don't see how this is NOT relational, and to me, I don't think it gets
anymore relational then this.
It is still sharing information from table to table, just not directly from
one to another because there are so many items per, I can't just add a cell
to the races table for every class that there is.
Ontop of this, I'll probably have a page were people can just check out
skills and stuff, and when they click on that skill, it will say, this skill
is available to this class...so from there, I'll be linking back to classes
and from classes to races.
So, I need you guys to set me or him straight.
Am I infact totally off and what I've described is NOT a relational dbase
structure or is my friend wrong and this IS a relational dbase structure?
To him, (if I'm understanding correctly) it would only be relational if it
was one table to another ie, races directly to classes. But because I'm
doing races to rclasses/rclasses to classes it's not relationa.
Thanks
Robso, I say one to one or one to many is relational
but if I'm hearing him correctly he's saying only one to one is relational|||Robert ,it will be very useful If you post DDL + sample data + expected
result.
"Robert Blackwell" <robbieatwowcentraldotcom> wrote in message
news:epQlBrpdDHA.3836@.tk2msftngp13.phx.gbl...
> http://www.wowcentral.com/random/relations_example.gif
> (I whipped up this little example in access really quick so I could kind
of
> illustrate it)
> Okay, I have a dbase with info about a game and stuff.
>
> There are races, and classes and skills etc.
> Races have many classes, and classes have many skills
> Now, I need to display a page about a race...and on that page, it will
> display which classes are available to it.
> So, you click on a class, and that will load a page about that class
> describing it and what skills are available to that class.
> Now, if each race only had one class, I would just make a cell on the
races
> table called class_id. But because each race (8 of them) will have up to 8
> classes I gotta make a second table that says which classes are available
to
> each race.
> I did this in tblRclasses.
> I did the same thing for classes and skills.
> Now, my friend is telling me that this is not a relational database
because
> the tables aren't sharring info but, like I said a second ago, if each
race
> only had one class, I wouldn't need the "middle man" table.
> I don't see how this is NOT relational, and to me, I don't think it gets
> anymore relational then this.
> It is still sharing information from table to table, just not directly
from
> one to another because there are so many items per, I can't just add a
cell
> to the races table for every class that there is.
> Ontop of this, I'll probably have a page were people can just check out
> skills and stuff, and when they click on that skill, it will say, this
skill
> is available to this class...so from there, I'll be linking back to
classes
> and from classes to races.
> So, I need you guys to set me or him straight.
> Am I infact totally off and what I've described is NOT a relational dbase
> structure or is my friend wrong and this IS a relational dbase structure?
> To him, (if I'm understanding correctly) it would only be relational if it
> was one table to another ie, races directly to classes. But because I'm
> doing races to rclasses/rclasses to classes it's not relationa.
> Thanks
> Rob
>|||I don't have any data etc yet because I'm trying to create the structure
properly first :(
But, as far as results go, take this website for example (it's the official
page of the fansite I'm working on)
http://www.worldofwarcraft.com/wow/townhall/
For reasons I don't understand, that entire site is static. But what I'm
planning to create on my page, is totally dynamic.
So say on that main page, you have the races and the images loaded
statically maybe, but the list of monsters is loaded dynamically and so are
the regions via repeat regions and stuff.
So, let's click on a race...Night Elves.
When you go to the NE page, all that stuff is loaded dynamically from the
dbase, the image, description, and then the the classes and races.
Now, i'm using the "inbetween" table rclasses to link races and classes
together ande that's how I'd get the info for classes. On that page, if you
click a class, it loads another dynamic page showing the information about
that class...and then on the class page, it will not only show the
informtaion about that class, but when more info is made available to the
public, I'm going to list which skills are available to each class...then
when you click the skill it loads up a skills description page etc...
And this goes for everything I'm trying to accomplish. Linking races,
classes, skills, regions and monsters together because races and monsters
come from a region and classes come from a race and skills come from classes
etc. etc. etc.
That's the best I can do to describe my intended out put I think.|||Robert
> For reasons I don't understand, that entire site is static.
If I undestand you correctly you are still planing you business logic of the
application.
Do you have database ?
If you do what is relationships between tables and what are the tables?
If you need some output report to be created by T-SQL please populate dummy
data and show us what is expected result.
"Robert Blackwell" <robbieatwowcentraldotcom> wrote in message
news:Oq0f1BqdDHA.2112@.TK2MSFTNGP10.phx.gbl...
> I don't have any data etc yet because I'm trying to create the structure
> properly first :(
>
> But, as far as results go, take this website for example (it's the
official
> page of the fansite I'm working on)
> http://www.worldofwarcraft.com/wow/townhall/
> For reasons I don't understand, that entire site is static. But what I'm
> planning to create on my page, is totally dynamic.
> So say on that main page, you have the races and the images loaded
> statically maybe, but the list of monsters is loaded dynamically and so
are
> the regions via repeat regions and stuff.
> So, let's click on a race...Night Elves.
> When you go to the NE page, all that stuff is loaded dynamically from the
> dbase, the image, description, and then the the classes and races.
> Now, i'm using the "inbetween" table rclasses to link races and classes
> together ande that's how I'd get the info for classes. On that page, if
you
> click a class, it loads another dynamic page showing the information about
> that class...and then on the class page, it will not only show the
> informtaion about that class, but when more info is made available to the
> public, I'm going to list which skills are available to each class...then
> when you click the skill it loads up a skills description page etc...
> And this goes for everything I'm trying to accomplish. Linking races,
> classes, skills, regions and monsters together because races and monsters
> come from a region and classes come from a race and skills come from
classes
> etc. etc. etc.
> That's the best I can do to describe my intended out put I think.
>|||One-to-many, one-to-one and many-to-many are all perfectly relational. It is all about how you model
the relations in the data model:
One to one: A common column in both tables which is unique (PK or UNIQUE constraint) in both tables.
One-to-many: A common column in both tables. In one table it is PK (the referenced table), in the
other it allow duplicates and is a FOREIGN KEY that references the PK of the referenced table.
Many-to-many: A table in between the two tables, where you keep the PK from both tables (as FK
referencing each of the other table's PK). This table creates your many-to-many relationships.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"Robert Blackwell" <robbieatwowcentraldotcom> wrote in message
news:OuK0sspdDHA.3128@.TK2MSFTNGP09.phx.gbl...
> so, I say one to one or one to many is relational
> but if I'm hearing him correctly he's saying only one to one is relational
>

Monday, February 20, 2012

Pivot Error

i am fallowing this link

http://sqljunkies.com/Article/705F07C3-69FE-4CAF-8CF8-CADBF145F372.scuk

last 15 th i am unable to understatnd the value to set tht pivotkey value for the output columns

INPUT COLUMNS LEGEND ID

CUSTOMER 861

PRODUCT 864

ID

OUPUT COLUMNS SOUREC COLUMN PIVOT KEY VALUE

CUSTOMER 861 ?

HamQty 864 ?

MILKQTY 864 ?

BEERQTY 864 ?

BREADQTY 864 ?

CHESSQTY 864 ?

HAMQTY CANNOT MAPPED WITH PIVOTKEY VALUE ERROR I AM GETTING

PLEASE HELP ME

You have run into a special degenerate case for the Pivot transform.

You do not have a pivot value. You simply have customers that purchase products, but you have no measurement such as “quantity” associated with the purchase. The existence of the row acts as a measure.

So what is the pivot value? There is not one.

You can set the lineage ID for the output columns to “-1” this is a special case use. When you do so, the value “TRUE” will be put into columns that have matching existing rows in the source.

This also means that your output columns need to be BOOLEAN typed so they can hold the value TRUE. (or NULL if not matched)

to use your example:

Input data

Customer(861) Product (864)

(the set key) (the pivot key)

-

JohnCheese

JohnBread

BillHam

Turns into

Customer CheeseExists BreadExists HamExists BeerExists

-- -- -

JohnTRUETRUENULL NULL

BillNULLNULLTRUENULL

Your output columns would be:

NameType SourceColumn PivotKeyValue

-- -

Customerchar861

CheeseExists VT_BOOL-1Cheese

BreadExistsVT_BOOL-1Bread

HamExistsVT_BOOL-1Ham

BeerExistsVT_BOOL-1Beer