Showing posts with label write. Show all posts
Showing posts with label write. Show all posts

Wednesday, March 21, 2012

Failed Second updat in dbo.aspnet_Membership?

hello,

I would to update the email indbo.aspnet_Membership and[dbo].[WebMaster].

I write a stored procedure that contain 2 update one for[dbo].[WebMaster] and another for dbo.aspnet_Membership

the update in WebMaster table succes but in the dbo.aspnet_Membersh failed.

No synatxe error in stored procedure.

Can any one help me ?

Amer Azzaz

Did you get any error? Can you post your script to create the stored procedure ?

Monday, March 19, 2012

Failed login MyMachine\ASPNET

I just wanted to write a simple WebService to return a dataset.
But when I am trying to debug it under Visual Studio, I get an exception
when calling conn.Open( ). The error message is "Failed to login user
myMachine\ASPNET". What is ASPNET? Why does Visual Studio invent that
account, if it fails to connect to my local MSDE? What can I do about it?
Please, I am not an administrator, so I need every detail.Make sure that you have a right Login as well as check if you have Windows
Authentication only. Change it to Mixed Authentication
"N Thorell" <NThorell@.discussions.microsoft.com> wrote in message
news:06CD83E4-9F83-4BE2-A695-652A7C4A7DF9@.microsoft.com...
> I just wanted to write a simple WebService to return a dataset.
> But when I am trying to debug it under Visual Studio, I get an exception
> when calling conn.Open( ). The error message is "Failed to login user
> myMachine\ASPNET". What is ASPNET? Why does Visual Studio invent
that
> account, if it fails to connect to my local MSDE? What can I do about
it?
> Please, I am not an administrator, so I need every detail.|||The local ASPNET Windows account is created automatically when you install
ASP.NET. This account is used by default as the security context for
ASP.NET applications.
You can either grant ASPNET access to SQL Server or reconfigure ASP.NET to
use a different account. See
http://support.microsoft.com/defaul...kb;en-us;316989 for details
on how to do this.
Hope this helps.
Dan Guzman
SQL Server MVP
"N Thorell" <NThorell@.discussions.microsoft.com> wrote in message
news:06CD83E4-9F83-4BE2-A695-652A7C4A7DF9@.microsoft.com...
>I just wanted to write a simple WebService to return a dataset.
> But when I am trying to debug it under Visual Studio, I get an exception
> when calling conn.Open( ). The error message is "Failed to login user
> myMachine\ASPNET". What is ASPNET? Why does Visual Studio invent
> that
> account, if it fails to connect to my local MSDE? What can I do about
> it?
> Please, I am not an administrator, so I need every detail.

Friday, February 17, 2012

Extracting data to CSV file

How do you write a query in Query Analyzer that extracts data from a table
into a .CSV file. I need the data in that format in order to upload into an
old Sybase database. ThanksEither use BCP, or select the Query / Results to File option in QA, or
use DTS, or use OSQL with the output switch option. In principle you
can do these things from a script in QA but usually that's not
necessary. If you want to automate it then use SQL Agent or some other
process to invoke one of those methods.
David Portas
SQL Server MVP
--|||SELECT ColA + ',' + ColB + ',' + ColC FROM TableName
Or
Use DTS to export the table to a CSV file
Or
Use DTS to export the file directly to Sybase.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"ChrisB" wrote:

> How do you write a query in Query Analyzer that extracts data from a table
> into a .CSV file. I need the data in that format in order to upload into a
n
> old Sybase database. Thanks|||Hi
create table ww
(
col1 int,
col2 varchar(50),
col3 varchar (50)
)
insert into ww values (47,'ReadyShip','(503)888-999')
insert into ww values (48,'MyShipper','(503)1212-454')
insert into ww values (49,'ReadyShip','(45)888-999')
insert into ww values (50,'MyShipper','(545)1212-454')
bcp northwind.dbo.ww out d:\test1.txt -c -t, -SMyServ -Uuser -Ppass
exec master..xp_cmdshell 'BCP northwind..ww IN
d:\test1.txt -c -C850 -SMyServ -Uuser -Ppass'
"ChrisB" <ChrisB@.discussions.microsoft.com> wrote in message
news:923AF22E-DF46-4DDB-84BE-18FCAEBE09FF@.microsoft.com...
> How do you write a query in Query Analyzer that extracts data from a table
> into a .CSV file. I need the data in that format in order to upload into
an
> old Sybase database. Thanks|||The query requires nothing special. Just execute the query within Query
Analyzer with the results going to the grid. When you get the results back,
click the mouse in the grid and choose the menu option File.. Save As..
"ChrisB" <ChrisB@.discussions.microsoft.com> wrote in message
news:923AF22E-DF46-4DDB-84BE-18FCAEBE09FF@.microsoft.com...
> How do you write a query in Query Analyzer that extracts data from a table
> into a .CSV file. I need the data in that format in order to upload into
> an
> old Sybase database. Thanks

Extracting Cube detailed info

Hello,

Could I write ActiveX Script in a DTS Package to return cube info (such as CubeName, CubeStatus, CubeSize, CubePartitions, CubeLastProcessed)? If that's
possible, I could then pump in the result into text file and import them into
a table for reporting purposes.

Please let me know if this is the best route to explore DSO objects or any alternative way of extracting this type of Cube data.

-Lawrence

If you are using Analysis Services 2000, yes, using DSO from a DTS package is a good option.

If you are using Analysis Services 2005, then use AMO (Microsoft.AnalysisServices.dll), I can post sample code, let me know please.

Adrian Dumitrascu

|||

Hello Adrian,

If you could post some sample DSO & AMO code for 2000 & 2005, that would be much appreciated. This would get me started as I don't know much about the object schema for DSO nor AMO. Let me know how to get to your code site.

Sincerely,

-Lawrence

|||

Hi,

here is a sample - without any warranty. For more information see http://msdn2.microsoft.com/en-us/library/ms345089.aspx:

using System;

using System.Collections.Generic;

using System.Text;

using System.Xml;

using System.IO;

using Microsoft.AnalysisServices;

namespace GetCubeInfo

{

class Program

{

static void Main(string[] args)

{

string dateFormat = "yyyy-MM-dd HH:mm:ss";

try

{

FileStream stream;

stream = File.Create(@."GetCubeInfo.xml");

XmlTextWriter writer = new XmlTextWriter(stream, Encoding.UTF8);

// Causes child elements to be indented

writer.Formatting = Formatting.Indented;

// Report element

writer.WriteProcessingInstruction("xml", "version=\"1.0\" encoding=\"utf-8\"");

writer.WriteStartElement("Server");

// Connect to the SSAS server

Server server = new Server();

server.Connect(@."Integrated Security=SSPI;Persist Security Info=False;Data Source=localhost\YUKON");

writer.WriteAttributeString("Name", null, server.Name);

writer.WriteAttributeString("ReportCreated", null, DateTime.Now.ToString(dateFormat));

// Get the Adventure Works cube(s)

foreach (Database database in server.Databases)

{

writer.WriteStartElement("Database");

writer.WriteAttributeString("Name", null, database.Name);

writer.WriteAttributeString("CreatedTimestamp", null, database.CreatedTimestamp.ToString(dateFormat));

writer.WriteAttributeString("LastSchemaUpdate", null, database.LastSchemaUpdate.ToString(dateFormat));

writer.WriteAttributeString("LastProcessed", null, database.LastProcessed.ToString(dateFormat));

writer.WriteAttributeString("LastUpdate", null, database.LastUpdate.ToString(dateFormat));

foreach (Cube cube in database.Cubes)

{

writer.WriteStartElement("Cube");

writer.WriteAttributeString("Name", null, cube.Name);

writer.WriteAttributeString("CreatedTimestamp", null, cube.CreatedTimestamp.ToString(dateFormat));

writer.WriteAttributeString("LastSchemaUpdate", null, cube.LastSchemaUpdate.ToString(dateFormat));

writer.WriteAttributeString("LastProcessed", null, cube.LastProcessed.ToString(dateFormat));

writer.WriteEndElement(); // Cube

}

foreach (Dimension dimension in database.Dimensions)

{

writer.WriteStartElement("Dimension");

writer.WriteAttributeString("Name", null, dimension.Name);

writer.WriteAttributeString("CreatedTimestamp", null, dimension.CreatedTimestamp.ToString(dateFormat));

writer.WriteAttributeString("LastSchemaUpdate", null, dimension.LastSchemaUpdate.ToString(dateFormat));

writer.WriteAttributeString("LastProcessed", null, dimension.LastProcessed.ToString(dateFormat));

writer.WriteEndElement(); // Dimension

}

writer.WriteEndElement(); // Database

writer.Flush();

}

writer.WriteEndElement(); // Server

writer.Flush();

}

catch (Exception exception)

{

// Uups

Console.WriteLine(exception.Message);

}

}

}

}

|||

Hello,

I really appreciate the AMO sample code! However, my cubes are currently in 2000, so I would wondering if someone could provide some sample DSO code like above. Output to text file would be good enough.

BTW, to setup automation for the AMO code above, would SSIS be the best place to setup the script? I am thinking either in "Script Component" or "ActiveX" tasks. Let me know if there is a better method.

Sincerely,

-Lawrence

|||

Hi Lawrence,

I strongly recommend you to use the Script Component if you run this code within a SSIS package, because you can use Visual Basic.Net and can use directly the (managed) AMO interface. The ActiveX task is only for backward compatibility reasons. For new code you should use the new ones otherwise you will have migration efforts in the future.

Whether to put it into a SSIS Package or not depends on your requirements and what you want to do with the data you have just gathered in that task. If it is part of your workflow/ETL process, or if you want to use some of the results in other steps/flows, or if you want to use the configuration support of SSIS, or if you want to use the scheduling support with the SQL Server Agent, or, or, or then the answer will be easy (Yes).

Regards,

Bertil

|||

Anyone could provide a sample script of the DSO objects that's related to what I am trying to gather here? I don't think AMO objects would work on 2000 cubes.

Your help is appreciated!

-Lawrence

Extracting Cube detailed info

Hello,

Could I write ActiveX Script in a DTS Package to return cube info (such as CubeName, CubeStatus, CubeSize, CubePartitions, CubeLastProcessed)? If that's
possible, I could then pump in the result into text file and import them into
a table for reporting purposes.

Please let me know if this is the best route to explore DSO objects or any alternative way of extracting this type of Cube data.

-Lawrence

If you are using Analysis Services 2000, yes, using DSO from a DTS package is a good option.

If you are using Analysis Services 2005, then use AMO (Microsoft.AnalysisServices.dll), I can post sample code, let me know please.

Adrian Dumitrascu

|||

Hello Adrian,

If you could post some sample DSO & AMO code for 2000 & 2005, that would be much appreciated. This would get me started as I don't know much about the object schema for DSO nor AMO. Let me know how to get to your code site.

Sincerely,

-Lawrence

|||

Hi,

here is a sample - without any warranty. For more information see http://msdn2.microsoft.com/en-us/library/ms345089.aspx:

using System;

using System.Collections.Generic;

using System.Text;

using System.Xml;

using System.IO;

using Microsoft.AnalysisServices;

namespace GetCubeInfo

{

class Program

{

static void Main(string[] args)

{

string dateFormat = "yyyy-MM-dd HH:mm:ss";

try

{

FileStream stream;

stream = File.Create(@."GetCubeInfo.xml");

XmlTextWriter writer = new XmlTextWriter(stream, Encoding.UTF8);

// Causes child elements to be indented

writer.Formatting = Formatting.Indented;

// Report element

writer.WriteProcessingInstruction("xml", "version=\"1.0\" encoding=\"utf-8\"");

writer.WriteStartElement("Server");

// Connect to the SSAS server

Server server = new Server();

server.Connect(@."Integrated Security=SSPI;Persist Security Info=False;Data Source=localhost\YUKON");

writer.WriteAttributeString("Name", null, server.Name);

writer.WriteAttributeString("ReportCreated", null, DateTime.Now.ToString(dateFormat));

// Get the Adventure Works cube(s)

foreach (Database database in server.Databases)

{

writer.WriteStartElement("Database");

writer.WriteAttributeString("Name", null, database.Name);

writer.WriteAttributeString("CreatedTimestamp", null, database.CreatedTimestamp.ToString(dateFormat));

writer.WriteAttributeString("LastSchemaUpdate", null, database.LastSchemaUpdate.ToString(dateFormat));

writer.WriteAttributeString("LastProcessed", null, database.LastProcessed.ToString(dateFormat));

writer.WriteAttributeString("LastUpdate", null, database.LastUpdate.ToString(dateFormat));

foreach (Cube cube in database.Cubes)

{

writer.WriteStartElement("Cube");

writer.WriteAttributeString("Name", null, cube.Name);

writer.WriteAttributeString("CreatedTimestamp", null, cube.CreatedTimestamp.ToString(dateFormat));

writer.WriteAttributeString("LastSchemaUpdate", null, cube.LastSchemaUpdate.ToString(dateFormat));

writer.WriteAttributeString("LastProcessed", null, cube.LastProcessed.ToString(dateFormat));

writer.WriteEndElement(); // Cube

}

foreach (Dimension dimension in database.Dimensions)

{

writer.WriteStartElement("Dimension");

writer.WriteAttributeString("Name", null, dimension.Name);

writer.WriteAttributeString("CreatedTimestamp", null, dimension.CreatedTimestamp.ToString(dateFormat));

writer.WriteAttributeString("LastSchemaUpdate", null, dimension.LastSchemaUpdate.ToString(dateFormat));

writer.WriteAttributeString("LastProcessed", null, dimension.LastProcessed.ToString(dateFormat));

writer.WriteEndElement(); // Dimension

}

writer.WriteEndElement(); // Database

writer.Flush();

}

writer.WriteEndElement(); // Server

writer.Flush();

}

catch (Exception exception)

{

// Uups

Console.WriteLine(exception.Message);

}

}

}

}

|||

Hello,

I really appreciate the AMO sample code! However, my cubes are currently in 2000, so I would wondering if someone could provide some sample DSO code like above. Output to text file would be good enough.

BTW, to setup automation for the AMO code above, would SSIS be the best place to setup the script? I am thinking either in "Script Component" or "ActiveX" tasks. Let me know if there is a better method.

Sincerely,

-Lawrence

|||

Hi Lawrence,

I strongly recommend you to use the Script Component if you run this code within a SSIS package, because you can use Visual Basic.Net and can use directly the (managed) AMO interface. The ActiveX task is only for backward compatibility reasons. For new code you should use the new ones otherwise you will have migration efforts in the future.

Whether to put it into a SSIS Package or not depends on your requirements and what you want to do with the data you have just gathered in that task. If it is part of your workflow/ETL process, or if you want to use some of the results in other steps/flows, or if you want to use the configuration support of SSIS, or if you want to use the scheduling support with the SQL Server Agent, or, or, or then the answer will be easy (Yes).

Regards,

Bertil

|||

Anyone could provide a sample script of the DSO objects that's related to what I am trying to gather here? I don't think AMO objects would work on 2000 cubes.

Your help is appreciated!

-Lawrence