Showing posts with label creating. Show all posts
Showing posts with label creating. Show all posts

Tuesday, March 20, 2012

an unkown insert type by me(!)

Hi Dear Coder Friends;

i just discovered below insert type in MSSQL 2005 Automatic creating insert sentence but i couldn't use because there is a syntax error.

INSERT INTO [KimlikBilgileri]

([CvId]

,[KimlikNo]

,[Ad]

,[Soyad]

,[Cinsiyet]

,[DogumTarihi]

,[UlkeId]

,[DogumYeri]

,[MedeniDurumu])

VALUES

(<CvId, int,>

,<KimlikNo, char(11),>

,<Ad, varchar(50),>

,<Soyad, varchar(50),>

,<Cinsiyet, char(5),>

,<DogumTarihi, smalldatetime,>

,<UlkeId, int,>

,<DogumYeri, varchar(50),>

,<MedeniDurumu, varchar(8),>)

Question for above;

-- What's this type called?

-- does it make any security bug like injections?

i want to use this one as a stored proc to add "create proc KimlikBilgilerInsert as ". So i think i don't have to declare one by one

am i right?

Thank you for your valuable knowledge Wink

The syntax error is due to the datatypes. Remove all the datatype indicators.

This is called an INSERT statement.

Yes, it is susceptible to SQL Injection -there are very long varchar(50) fields, and there is no data validation. I would consider where the values are gathered, and if from textboxes on a form, then I would put this statement in a stored procedure and add some data validation code.

Thursday, March 8, 2012

An error has occurred during report processing.

While creating a new report in the report designer I can pull all the information from my cube,
however later after it is created i get this message:

An error has occurred during report processing.
Query execution failed for data set 'MedContv15S'.
Unable to recognize the requested property ID 'ReturnCellProperties'.

anybody a clue ?

I meanwhile tried to set "ConnectTo" to 8.0, however after that i get this error:

An error occured during local report processing
An error has occured during report processing
Cannot create a connection to data source 'MeD'.
The LCID or Compare String flags have already been set by an existing connection. They cannot be changed

Did you manage to resolve this. I have the same problem?

An error has occurred during report processing.

While creating a new report in the report designer I can pull all the information from my cube,
however later after it is created i get this message:

An error has occurred during report processing.
Query execution failed for data set 'MedContv15S'.
Unable to recognize the requested property ID 'ReturnCellProperties'.

anybody a clue ?

I meanwhile tried to set "ConnectTo" to 8.0, however after that i get this error:

An error occured during local report processing
An error has occured during report processing
Cannot create a connection to data source 'MeD'.
The LCID or Compare String flags have already been set by an existing connection. They cannot be changed

Did you manage to resolve this. I have the same problem?

Saturday, February 25, 2012

AMO:How to create a new role by using vb.net

Hi,

I want to know is it same to create a role in Analysis Server 2000.why because there we are creating a role in Database as well as in Cube.i want to know in AS 2005 also we need to create a role like the same.

If any one knows please help me on this.

Hi,

There is a thread about creating roles with AMO here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1795829&SiteID=1

In AS2005, you need to create one Role in the Database (where you will define the users) and then Permissions as needed: DatabasePermissions, DataSourcePermissions, DimensionPermissions, CubePermissions, MiningStructurePermissions and MiningModelPermissions.

Adrian Dumitrascu

AMO:Can any one knows how to drop the permissions

HI all,

I am working on AMO and .NET.In my application i have to create a role and that i am able to do it.When i am creating a role i provided some Database and cube permissions.while dropping the role i am getting some error message is like permissions are exist on that object(ROLE).So what i did is i dropped permissions first after that i am tried to drop the role.

Still i am getting the same problem when i am dropping the permissions.I am sending that part of code which i am using in my application.

dbPerm = amodatabase.DatabasePermissions.FindByRole(RoleName)
dbPerm.Drop(DropOptions.IgnoreFailures)
cubePerm = amocube.CubePermissions.FindByRole(RoleName)
cubePerm.Drop(DropOptions.IgnoreFailures)
Newrole.Drop(DropOptions.IgnoreFailures)

after dropping the role i am commiting the transaction.and i am getting below error message while deleting.

Errors in the metadata manager. The cube permission with the ID of 'CubePermission 3', Name of 'CubePermission 3' was invalidated by operations in the transaction. Errors in the metadata manager. The transaction cannot be committed because one or more objects were invalidated during the transaction

Please help me on this and correct my code.

Regards,

vishwesh

Set Newrole.Drop(DropOptions.IgnoreFailures) to Newrole.Drop(DropOptions.AlterOrDeleteDependents).

I believe you can remove the following:

dbPerm = amodatabase.DatabasePermissions.FindByRole(RoleName)
dbPerm.Drop(DropOptions.IgnoreFailures)
cubePerm = amocube.CubePermissions.FindByRole(RoleName)
cubePerm.Drop(DropOptions.IgnoreFailures)

B.

|||

Hi Bryan,

I tried with the above code and executes but i am getting some strange error see below.

Errors in the metadata manager. Impact analysis inside a pending transaction cannot support CREATE, DELETE, or ALTER commands.

could you please let me know what could be the problem.

Regards,

vishweshwar

|||

Could you post your revised code?

Thanks,
B.

|||

Hi Bryan,

Please find the revised code.

Newrole = amodatabase.Roles.FindByName(RoleName)
If Newrole Is Nothing Then
Throw New ApplicationException("Role not exist in database")
Else
Newrole.Drop()
amodatabase.Update()
amoserver.CommitTransaction()
End If

Please help me on this how to sort it out.

|||

Bryan's suggestion was to use the AlterOrDeleteDependants option on the Drop method.

Newrole = amodatabase.Roles.FindByName(RoleName)
If Newrole Is Nothing Then
Throw New ApplicationException("Role not exist in database")
Else

Newrole.Drop(DropOptions.AlterOrDeleteDependents).

amodatabase.Update()
amoserver.CommitTransaction()
End If

Friday, February 24, 2012

AMO DataSource ConnectionString Password and ConnectionStringSecurity

I am creating a datasource using AMO with the password embedded in the connectionstring to the database. After the datasource has been updated to the server, if I load it again, the password is removed from the connectionstring. I tried setting the ConnectionStringSecurity to "Unchanged" but it's reset back to "RemovePassword" when I load the datasource object again. Any ideas on how to avoid entering the password everytime?

This is not a bug in the product.
You are running into the situation when Analysis Server for security reasons strips any passwords from any responcse it sends to the users. Once you've told Analysis Server your password, it will keep it for internal usage only, it will never return it back to you. That is to reduce the risk of exposure: even if malitious user gains access to Analysis Server, it will not be able to learn your password.

It is true, in your situation you will need to work little harder in case and if you need to change data source using AMO.

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

Thursday, February 9, 2012

Alternative to Creating View with Union in two databases?

I attempted to create a view in SQL Server 2000 that Unions two
queries. The first part of the query gets data from the local server,
the second part gets info from a linked server. (The query works fine
in Query Analyzer.)

I received this error when I tried to save the query:

ODBC error: [Microsoft][ODBC SQL Server Driver] The operation could
not be performed because the OLE DB provider 'SQLOLEDB' was unable to
begin a distributed transaction.

[Microsft][ODBC SQL Server Driver][SQL Server][OLE/DB provider
returned message: New transaction cannot enlist in the specified
transaction coordinator.]

After a little reading I discovered the "Database limitation":
"A view can be created on a table only in the database the view
creator is accessing".

That's my problem... is there a simple solution or alternative to
creating a view?

Thanks,
Mattmattd@.semiconductor.com (Matt D) wrote in news:7bd0381c.0310070503.4d416d94@.posting.google.c om:

> That's my problem... is there a simple solution or alternative to
> creating a view?

A stored procedure will likely do the trick.

--
Ross Presser -- rpresser AT imtek DOT com
... seeking a new quote ...|||Matt D (mattd@.semiconductor.com) writes:
> I attempted to create a view in SQL Server 2000 that Unions two
> queries. The first part of the query gets data from the local server,
> the second part gets info from a linked server. (The query works fine
> in Query Analyzer.)
> I received this error when I tried to save the query:

I had no problems to create a view spanning two servers.

Since you talk about saving query, I get the idea that you might
be using Enterprise Manager for the task. Try running the CREATE VIEW
statement from Query Analyzer instead.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp