|
i´m trying to select the names of dimension members from a data cube. when working under sql server 2000, i´m using this mdx query select distinct [Projekt_Owner].[Projekt Owner] from datacube and it´s working just fine... but when i´m trying to do the same under sql server 2005, i always get the same error:Error (Data mining): Either the user, does not have permission to access the referenced mining model or the object does not exist. can anyone help my with this?
cellardoor
|
|
|
|
|
using VS2005;
Can someone please help me out with this:
I have a datatable that contains several columns including "ReportDate" and "Amount". What I want to be able to do is retrieve the value from the datatable in the "Amount" column when all I know is the same rows "ReportDate" value. The "ReportDate" column is DateTime and the "Amount" column is Decimal. I know how to get this direct from the database table but not the corresponding datatable.
As part of the above answer, how do you pass a variable to the Select statement of a datatable lookup. I assume you can't use the same method of passing variables/paramaters to a SQL Statement because I can't seem to be able to do that either!
Glen Harvy
|
|
|
|
|
You could use DataView over your DataTable by applying a filter and then query the value for the desired column, for e.g. "Where ReportDate = '1/1/2006'".
Farhan Noor Qureshi
|
|
|
|
|
Hello:
Now i want to bulk insert a dataset into an excel file, is there any good method?Thanks in advance!
Plus: i am wodering the method of firstly store the datatable in sql sever,then use dts. but i think it seems a little redundant and time-wasting.
|
|
|
|
|
I don't know how do it from TSQL but here is how I have done it form C++
CString str;
str.Format("SELECT * INTO [Excel 8.0;DATABASE=%s].[%s] FROM [%s]", ExcelFile, Worksheet, Table);
pConn->Execute(str.AllocSysString(), NULL, adExecuteNoRecords);
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Where is it?
--
-= Proudly Made on Earth =-
|
|
|
|
|
IIRC, it is in the Server Management Studio.
That's no moon, it's a space station. - Obi-wan KenobiLast modified: Monday, August 14, 2006 2:29:30 PM --
|
|
|
|
|
There isn't one, SQL Server Management Studio replaces both Enterprise Manager and Query Analyzer.
If you only have SQL Server 2005 Express Edition, you have to download Management Studio Express separately. Otherwise you have to use Server Explorer in VS, or the sqlcmd utility (a replacement for isql and osql, although osql is still supplied).
|
|
|
|
|
I have the developer's edition of the server. I couldn't find such a tool on the DVD. Is the management studio a "real server" only thing? I suppose that if you can download it for SQL Server Express, there ought to be one available for the developer's edition. I'll check it out. Thanks!
--
Hey, TiVo! Suggest this!
|
|
|
|
|
There's a checkbox for it in the installer: select 'Workstation components'. It's not checked by default.
|
|
|
|
|
I'm pretty sure I checked everything except all the buzzword stuff (data mining, reporting, etc).
--
Behold, for I am THE CORRUPTOR!
|
|
|
|
|
Go to Control Panel, Add/Remove Programs, select Microsoft SQL Server 2005 from the list, then click Change. If 'Workstation components' appears under 'SQL Server 2005 common components', you have it installed.
If not, insert the CD or DVD, click the 'To install a new component, click here' link, enter the path to setup.exe (on the DVD, for the 32-bit version, this is under (DVD-drive):\SQL Server x86\Servers) and OK. Click through the wizard until you get to the 'Components to install' screen, then check 'Workstation components, Books Online and development tools', which is the bottom checkbox.
Yeah. Weird installer. SQL Server supports multiple independent instances of the product installed simultaneously with different service pack levels. I think it even supports having different instances being different editions: right now I have a default instance of SQL 2000 Developer Edition and a named one, and an instance of SQL Express, and a named instance of SQL Server 2005 Developer Edition. That's pretty tricky to accomplish with Windows Installer. I wish it didn't create so much clutter in Add/Remove Programs though.
|
|
|
|
|
Private Function createThumnail(ByVal ImageStream As Stream,
ByVal tWidth As Double, ByVal tHeight As Double) As Byte()
Function NewthumbSize(ByVal currentwidth As Double, ByVal
currentheight As Double, ByVal newWidth As Double, ByVal newHeight As Double)
tech_garden@yahoo.com
|
|
|
|
|
Wrong forum. You'll get a better response in the C# or VB.NET forum
|
|
|
|
|
Stream is an object and it should be passed by ref which is the default action for ref types so ...
Actually, I was going to answer but I can't be bothered to correct the spelling and capitalization.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
I have a class which looks like that:
class Stuff
{
Dictionary<string, object> properties;
List<Stuff> children;
}
I'm writing a home made XML 'serialization'.
I quote that, because it's not serialization, I'm writing the XML writer myself (without System.Reflection).
I'm using a shema like that:
<stuff count=2 key1="value1" key2="value2" key3="value3">
<stuf>
.........
</stuff>
<stuf>
.........
</stuff>
</stuff>
where count = children.Count
and key1,2,3 are the keys in the properties dictionary and value1,2,3 their values.
properties is to be filled by the user with whatever (s)he wants.
Now my problem is:
==============
As the user could put whatever (s)he wants in the properties dictionary (s)he could as well create a key named 'count', therefore the 'count' atribute will be present twice in the tag.
It's not a problem for my reader (which expect a first count followed by any kind of attribute) but it might be for other people wanting to consume my XML documents.
What do you think?
it's actually much easier this way...
(particularly because this sample output is far from the whole story)
|
|
|
|
|
Have you looked into xsd.exe for class generation? Personally I like strong types. Count should be implicit, btw.
<stuff>
<item key="value1" value="someValue">
<item key="value2" value="someValue">
<item key="value3" value="someValue">
<item key="value4" value="someValue">
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
uh?
I don't think auto-generated code will work in this case...
count is explicit only for performance reason....
|
|
|
|
|
Hi, I need to create a 6 character random alphnumberic serial number. How can this be achieved in SQL Server 2000? I have been searching and found that Oracle has a function for this, so I am assuming there should be one for SQL then. I could do this easily in .net - but I dont want to have to keep sending a request to the database to check that this number is unique. I would prefer to do the whole thing in a SQL function. So far the only way I have been able to work out, is too create a new GUID - select 6 characters from it - then check that these are not already used in the table (otherwise create a new one and repeat) and insert it.
Any help on this?
Thanks
Wayde
|
|
|
|
|
Ok, I found a way of doing this, may not be the best, but it what I thought of:
DECLARE @Length INT, @Count INT, @RandNum INT, @RandomString VARCHAR(6), @IsValid BIT
SELECT @RandomString = '', @Count = 0, @IsValid = 0, @Length = 6
WHILE (@IsValid = 0)
BEGIN
WHILE @Count < @Length
BEGIN
SET @RandNum = SUBSTRING(CAST(Rand() AS VARCHAR(20)), 3, 2)
IF (((@RandNum > = ASCII('0')) And (@RandNum <= ASCII('9')) Or (@RandNum > = ASCII('A')) And (@RandNum < = ASCII('Z'))))
BEGIN
SET @RandomString = @RandomString + CHAR(@RandNum)
SET @Count = @Count + 1
END
END
--Check here that the number is unique
IF (SELECT certificateSerialNumber FROM Certificate WHERE certificateSerialNumber = @RandomString) IS Null
BEGIN
SET @IsValid = 1
END
END
SELECT @RandomString
This cannot be used as a function though, due to the RandNumber generator. You can also emit the last part that checks if the value is unique. Change the @Length and @RandomString size to suit the size of the field that you need.
|
|
|
|
|
I had created a table User with a field UserOpinion which is of 'text' data type here maximum of onnly 10 lines i am able to enter data rest all data are getting truncated. Is there any way to avoid this truncation of data so that i can enter more than 100 lines of data.
ItsMe
|
|
|
|
|
Are you looking at the result in Query Analyzer? Query Analyzer has a limit on the number of characters it will display from any given column, which defaults to 256. You can change this in Tools, Options, Results tab, 'Maximum characters per column'.
Otherwise I've never heard of data being truncated like this. Check how you're adding it to the database. Perhaps you need to increase the Size property of the Parameter object you're using - I normally set this to the length of the data I'm going to set.
|
|
|
|
|
No i have designed a table with text as the data type. By rule this text data type enable a field to accept more than 2 lakh characters. But if inserted data containing 10 thousand characters and tried to fetch the data from backend , i also checked for the data length , it showed only maximum of 4000 not more than that.
ItsMe
|
|
|
|
|
That sounds like you're using a parameter of nvarchar type, which in classic ADO is adVarWChar or in ADO.NET SqlDbType.NVarChar . This type has a limit of 4000 characters in SQL Server 2000. You need to use adLongVarChar to match a text column in ADO, or SqlDbType.Text .
If you want Unicode support in your database field, use ntext rather than text . If developing exclusively for SQL Server 2005, consider using {n}varchar(max) rather than {n}text .
|
|
|
|
|
Hi,
I need to set mutiple values parameter in Sybase ASE stored procedure. I don't know whether Sybase support array type parameter and how to set it.
|
|
|
|