Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Thursday, March 29, 2012

Creating an Index timing out

I am creating an index on a table wit 35 million records but I get the error

'TT_ObjPerformance' table
- Unable to create index 'IX_TT_ObjPerformance_CACode'.
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

How can I get the index created?

Thanks
SQL Server newbie

From where are you creating the index? via query analyzer/job/some front end( hopefully not)?

Creating an Assembly that calls a COM object

Hi,
I am trying to create an Assembly in SQL Server 2005 that calls a C# DLL
which in turn calls some COM stuff. I get an error message in SQL Server 200
5
related to COM interoperability (does not exist in SQL catalog). I can give
you the exact error message if needed. Any ideas on how this can be handled?
Appreciate any help. Thanks.Can anyone help me with my question? Thanks.
"KMP" wrote:

> Hi,
> I am trying to create an Assembly in SQL Server 2005 that calls a C# DLL
> which in turn calls some COM stuff. I get an error message in SQL Server 2
005
> related to COM interoperability (does not exist in SQL catalog). I can giv
e
> you the exact error message if needed. Any ideas on how this can be handle
d?
> Appreciate any help. Thanks.|||Hello KMP,
Providing the error and code in question is always a good idea. Did you cata
log
the assembly as unsafe?
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||Here is the error message (below) that I get when I try to create an
assembly in SQL Server2005 pointing to Test.dll (just an example name).
Test.dll (which is C# dll) refers to some COM objects inside it. I thinking
that is what is causing the Assembly to fail. I hope this info is good
enough. Please let me know if I need to pass on any more info. Thanks.
========================================
=============
Assembly "interop.testlib,
version=0.0.0.0,culture=neutral,publickeytoken=null" was not found in SQL
catalog
========================================
=============
"Kent Tegels" wrote:

> Hello KMP,
> Providing the error and code in question is always a good idea. Did you ca
talog
> the assembly as unsafe?
> Thank you,
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>
>|||Hello KMP,

> Here is the error message (below) that I get when I try to create an
> assembly in SQL Server2005 pointing to Test.dll (just an example
> name). Test.dll (which is C# dll) refers to some COM objects inside
> it. I thinking that is what is causing the Assembly to fail. I hope
> this info is good enough. Please let me know if I need to pass on any
> more info. Thanks.
Its been ages since I need to do something like this from even regular .NET.
My first thought is that you probably need to run TLBIMP and get a PIA into
the directory with your DLL so that it also catalogs it. You may also have
to manually deploy it.
I'm pushing this over to the CLR newsgroup and we'll see if Niels chimes
in with additional thoughts.
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||I was wondering if anyone could help me with this issue. Thanks in
anticipation...
"Kent Tegels" wrote:

> Hello KMP,
>
> Its been ages since I need to do something like this from even regular .NE
T.
> My first thought is that you probably need to run TLBIMP and get a PIA int
o
> the directory with your DLL so that it also catalogs it. You may also have
> to manually deploy it.
> I'm pushing this over to the CLR newsgroup and we'll see if Niels chimes
> in with additional thoughts.
> Thank you,
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>
>|||examnotes <KMP@.discussions.microsoft.com> wrote in news:88F5ED5D-
B63B-436D-AB35-B5B90AA66C75@.microsoft.com:

> I was wondering if anyone could help me with this issue. Thanks in
> anticipation...
>
Sorry, I didn't see this post until now. Can you please re-post the issue
you have.
Niels
****************************************
**********
* Niels Berglund
* http://staff.develop.com/nielsb
* nielsb at develop dot com
* "A First Look at SQL Server 2005 for Developers"
* http://www.awprofessional.com/title/0321180593
****************************************
**********|||I am trying to create an Assembly in SQL Server 2005 that calls a C# DLL
which in turn calls some COM stuff. I get an error message in SQL Server 200
5
related to COM interoperability (does not exist in SQL catalog). I can give
you the exact error message if needed. Thanks.
"KMP" wrote:

> Hi,
> I am trying to create an Assembly in SQL Server 2005 that calls a C# DLL
> which in turn calls some COM stuff. I get an error message in SQL Server 2
005
> related to COM interoperability (does not exist in SQL catalog). I can giv
e
> you the exact error message if needed. Any ideas on how this can be handle
d?
> Appreciate any help. Thanks.|||Hello KMP,

> I am trying to create an Assembly in SQL Server 2005 that calls a C#
> DLL which in turn calls some COM stuff. I get an error message in SQL
> Server 2005 related to COM interoperability (does not exist in SQL
> catalog). I can give you the exact error message if needed. Thanks.
Reposting to m.p.ss.clr, please continue thread there.
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/|||What is "m.p.ss.clr"?
"Kent Tegels" wrote:

> Hello KMP,
>
> Reposting to m.p.ss.clr, please continue thread there.
> Thank you,
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>
>

Creating an Assembly that calls a COM object

Hi,
I am trying to create an Assembly in SQL Server 2005 that calls a C# DLL
which in turn calls some COM stuff. I get an error message in SQL Server 2005
related to COM interoperability (does not exist in SQL catalog). I can give
you the exact error message if needed. Any ideas on how this can be handled?
Appreciate any help. Thanks.
Can anyone help me with my question? Thanks.
"KMP" wrote:

> Hi,
> I am trying to create an Assembly in SQL Server 2005 that calls a C# DLL
> which in turn calls some COM stuff. I get an error message in SQL Server 2005
> related to COM interoperability (does not exist in SQL catalog). I can give
> you the exact error message if needed. Any ideas on how this can be handled?
> Appreciate any help. Thanks.
|||Hello KMP,
Providing the error and code in question is always a good idea. Did you catalog
the assembly as unsafe?
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/
|||Here is the error message (below) that I get when I try to create an
assembly in SQL Server2005 pointing to Test.dll (just an example name).
Test.dll (which is C# dll) refers to some COM objects inside it. I thinking
that is what is causing the Assembly to fail. I hope this info is good
enough. Please let me know if I need to pass on any more info. Thanks.
================================================== ===
Assembly "interop.testlib,
version=0.0.0.0,culture=neutral,publickeytoken=nul l" was not found in SQL
catalog
================================================== ===
"Kent Tegels" wrote:

> Hello KMP,
> Providing the error and code in question is always a good idea. Did you catalog
> the assembly as unsafe?
> Thank you,
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>
>
|||Hello KMP,

> Here is the error message (below) that I get when I try to create an
> assembly in SQL Server2005 pointing to Test.dll (just an example
> name). Test.dll (which is C# dll) refers to some COM objects inside
> it. I thinking that is what is causing the Assembly to fail. I hope
> this info is good enough. Please let me know if I need to pass on any
> more info. Thanks.
Its been ages since I need to do something like this from even regular .NET.
My first thought is that you probably need to run TLBIMP and get a PIA into
the directory with your DLL so that it also catalogs it. You may also have
to manually deploy it.
I'm pushing this over to the CLR newsgroup and we'll see if Niels chimes
in with additional thoughts.
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/
|||I was wondering if anyone could help me with this issue. Thanks in
anticipation...
"Kent Tegels" wrote:

> Hello KMP,
>
> Its been ages since I need to do something like this from even regular .NET.
> My first thought is that you probably need to run TLBIMP and get a PIA into
> the directory with your DLL so that it also catalogs it. You may also have
> to manually deploy it.
> I'm pushing this over to the CLR newsgroup and we'll see if Niels chimes
> in with additional thoughts.
> Thank you,
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>
>
|||=?Utf-8?B?S01Q?= <KMP@.discussions.microsoft.com> wrote in news:88F5ED5D-
B63B-436D-AB35-B5B90AA66C75@.microsoft.com:

> I was wondering if anyone could help me with this issue. Thanks in
> anticipation...
>
Sorry, I didn't see this post until now. Can you please re-post the issue
you have.
Niels
**************************************************
* Niels Berglund
* http://staff.develop.com/nielsb
* nielsb at develop dot com
* "A First Look at SQL Server 2005 for Developers"
* http://www.awprofessional.com/title/0321180593
**************************************************
|||I am trying to create an Assembly in SQL Server 2005 that calls a C# DLL
which in turn calls some COM stuff. I get an error message in SQL Server 2005
related to COM interoperability (does not exist in SQL catalog). I can give
you the exact error message if needed. Thanks.
"KMP" wrote:

> Hi,
> I am trying to create an Assembly in SQL Server 2005 that calls a C# DLL
> which in turn calls some COM stuff. I get an error message in SQL Server 2005
> related to COM interoperability (does not exist in SQL catalog). I can give
> you the exact error message if needed. Any ideas on how this can be handled?
> Appreciate any help. Thanks.
|||Hello KMP,

> I am trying to create an Assembly in SQL Server 2005 that calls a C#
> DLL which in turn calls some COM stuff. I get an error message in SQL
> Server 2005 related to COM interoperability (does not exist in SQL
> catalog). I can give you the exact error message if needed. Thanks.
Reposting to m.p.ss.clr, please continue thread there.
Thank you,
Kent Tegels
DevelopMentor
http://staff.develop.com/ktegels/
|||What is "m.p.ss.clr"?
"Kent Tegels" wrote:

> Hello KMP,
>
> Reposting to m.p.ss.clr, please continue thread there.
> Thank you,
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>
>
sql

Creating an Assembly that calls a COM object

Hi,
I am trying to create an Assembly in SQL Server 2005 that calls a C# DLL
which in turn calls some COM stuff. I get an error message in SQL Server 2005
related to COM interoperability (does not exist in SQL catalog). I can give
you the exact error message if needed. Any ideas on how this can be handled?
Appreciate any help. Thanks.Can anyone help me with my question? Thanks.
"KMP" wrote:
> Hi,
> I am trying to create an Assembly in SQL Server 2005 that calls a C# DLL
> which in turn calls some COM stuff. I get an error message in SQL Server 2005
> related to COM interoperability (does not exist in SQL catalog). I can give
> you the exact error message if needed. Any ideas on how this can be handled?
> Appreciate any help. Thanks.|||Here is the error message (below) that I get when I try to create an
assembly in SQL Server2005 pointing to Test.dll (just an example name).
Test.dll (which is C# dll) refers to some COM objects inside it. I thinking
that is what is causing the Assembly to fail. I hope this info is good
enough. Please let me know if I need to pass on any more info. Thanks.
=====================================================
Assembly "interop.testlib,
version=0.0.0.0,culture=neutral,publickeytoken=null" was not found in SQL
catalog
====================================================="Kent Tegels" wrote:
> Hello KMP,
> Providing the error and code in question is always a good idea. Did you catalog
> the assembly as unsafe?
> Thank you,
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>
>|||I was wondering if anyone could help me with this issue. Thanks in
anticipation...
"Kent Tegels" wrote:
> Hello KMP,
> > Here is the error message (below) that I get when I try to create an
> > assembly in SQL Server2005 pointing to Test.dll (just an example
> > name). Test.dll (which is C# dll) refers to some COM objects inside
> > it. I thinking that is what is causing the Assembly to fail. I hope
> > this info is good enough. Please let me know if I need to pass on any
> > more info. Thanks.
> Its been ages since I need to do something like this from even regular .NET.
> My first thought is that you probably need to run TLBIMP and get a PIA into
> the directory with your DLL so that it also catalogs it. You may also have
> to manually deploy it.
> I'm pushing this over to the CLR newsgroup and we'll see if Niels chimes
> in with additional thoughts.
> Thank you,
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>
>|||=?Utf-8?B?S01Q?= <KMP@.discussions.microsoft.com> wrote in news:88F5ED5D-
B63B-436D-AB35-B5B90AA66C75@.microsoft.com:
> I was wondering if anyone could help me with this issue. Thanks in
> anticipation...
>
Sorry, I didn't see this post until now. Can you please re-post the issue
you have.
Niels
--
**************************************************
* Niels Berglund
* http://staff.develop.com/nielsb
* nielsb at develop dot com
* "A First Look at SQL Server 2005 for Developers"
* http://www.awprofessional.com/title/0321180593
**************************************************|||I am trying to create an Assembly in SQL Server 2005 that calls a C# DLL
which in turn calls some COM stuff. I get an error message in SQL Server 2005
related to COM interoperability (does not exist in SQL catalog). I can give
you the exact error message if needed. Thanks.
"KMP" wrote:
> Hi,
> I am trying to create an Assembly in SQL Server 2005 that calls a C# DLL
> which in turn calls some COM stuff. I get an error message in SQL Server 2005
> related to COM interoperability (does not exist in SQL catalog). I can give
> you the exact error message if needed. Any ideas on how this can be handled?
> Appreciate any help. Thanks.|||What is "m.p.ss.clr"?
"Kent Tegels" wrote:
> Hello KMP,
> > I am trying to create an Assembly in SQL Server 2005 that calls a C#
> > DLL which in turn calls some COM stuff. I get an error message in SQL
> > Server 2005 related to COM interoperability (does not exist in SQL
> > catalog). I can give you the exact error message if needed. Thanks.
> Reposting to m.p.ss.clr, please continue thread there.
> Thank you,
> Kent Tegels
> DevelopMentor
> http://staff.develop.com/ktegels/
>
>|||Probably a newsgroup on this server named microsoft.public.sqlserver.clr.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"KMP" <KMP@.discussions.microsoft.com> wrote in message
news:B98ADDDA-970A-42F1-92A9-831A2DBD51B9@.microsoft.com...
> What is "m.p.ss.clr"?
> "Kent Tegels" wrote:
>> Hello KMP,
>> > I am trying to create an Assembly in SQL Server 2005 that calls a C#
>> > DLL which in turn calls some COM stuff. I get an error message in SQL
>> > Server 2005 related to COM interoperability (does not exist in SQL
>> > catalog). I can give you the exact error message if needed. Thanks.
>> Reposting to m.p.ss.clr, please continue thread there.
>> Thank you,
>> Kent Tegels
>> DevelopMentor
>> http://staff.develop.com/ktegels/
>>|||I haven't found this newsgroup. Can you please send me a link (if
available)? Thanks.
"Tibor Karaszi" wrote:
> Probably a newsgroup on this server named microsoft.public.sqlserver.clr.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "KMP" <KMP@.discussions.microsoft.com> wrote in message
> news:B98ADDDA-970A-42F1-92A9-831A2DBD51B9@.microsoft.com...
> >
> > What is "m.p.ss.clr"?
> >
> > "Kent Tegels" wrote:
> >
> >> Hello KMP,
> >>
> >> > I am trying to create an Assembly in SQL Server 2005 that calls a C#
> >> > DLL which in turn calls some COM stuff. I get an error message in SQL
> >> > Server 2005 related to COM interoperability (does not exist in SQL
> >> > catalog). I can give you the exact error message if needed. Thanks.
> >>
> >> Reposting to m.p.ss.clr, please continue thread there.
> >>
> >> Thank you,
> >> Kent Tegels
> >> DevelopMentor
> >> http://staff.develop.com/ktegels/
> >>
> >>
> >>
>|||Seems MS haven't refreshed the web site for this yes
(http://www.microsoft.com/technet/community/newsgroups/server/sql.mspx). But if you refresh your
newsreader, the group should show up.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"KMP" <KMP@.discussions.microsoft.com> wrote in message
news:29900A69-0704-40D1-AFC1-05644386F690@.microsoft.com...
> I haven't found this newsgroup. Can you please send me a link (if
> available)? Thanks.
> "Tibor Karaszi" wrote:
>> Probably a newsgroup on this server named microsoft.public.sqlserver.clr.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> Blog: http://solidqualitylearning.com/blogs/tibor/
>>
>> "KMP" <KMP@.discussions.microsoft.com> wrote in message
>> news:B98ADDDA-970A-42F1-92A9-831A2DBD51B9@.microsoft.com...
>> >
>> > What is "m.p.ss.clr"?
>> >
>> > "Kent Tegels" wrote:
>> >
>> >> Hello KMP,
>> >>
>> >> > I am trying to create an Assembly in SQL Server 2005 that calls a C#
>> >> > DLL which in turn calls some COM stuff. I get an error message in SQL
>> >> > Server 2005 related to COM interoperability (does not exist in SQL
>> >> > catalog). I can give you the exact error message if needed. Thanks.
>> >>
>> >> Reposting to m.p.ss.clr, please continue thread there.
>> >>
>> >> Thank you,
>> >> Kent Tegels
>> >> DevelopMentor
>> >> http://staff.develop.com/ktegels/
>> >>
>> >>
>> >>
>>

Tuesday, March 27, 2012

Creating a View from ASP.Net page (Problems)

Hello,

I am having an error when using the CREATE VIEW statement and trying to execute it from an ASP.net page. I get an error that says something along the lines of 'dbo' schema does not exist or you do not have permissions to access it. I have checked and the user has been granted every permission I can think of (including setting it to the DB owner), but it does not work.

I am able to execute all the Select, Update, Insert statements that I wish to, and when I copy the statement into the SQL 2005 Management studio query menu it works perfectly, it just gives the error message from the ASP.net page.

Here is an example (or as close as I can remember at this point) of some code I tried:

myCommand.Connection = myConnection
myCommand.Open()
myCommand.CommandText = "Create View TestView as Select 1, 2"
myCommand.ExecuteNonQuery()
myCommand.Close()

Any help would be appreciated.

Thanks,
StuporMan

I dont think that is a valid SQL statement.|||

You are correct, but it can be made correct by changing the statement to:

"Create View TestView as Select 1 as test1, 2 as test2"

(you can verify this by running in SQL Server management studio).

Andthis does not change the ASP.net error message.

You can do thefollowing test to show what I mean.

Create an ASP.net page with 2buttons.

One button click runs this code:

myCommand.Connection = myConnection
myCommand.Open()
myCommand.CommandText = "Select 1 as test1, 2 as test2"
myCommand.ExecuteNonQuery()
myCommand.Close()

(I have left the definitions and SQL connection string up to you)

On the other button click run this:

myCommand.Connection = myConnection
myCommand.Open()
myCommand.CommandText = "Create View TestView as Select 1 as test1, 2 as test2"
myCommand.ExecuteNonQuery()
myCommand.Close()

And you should produce the same error message as I am getting.

Thanks,

StuporMan

|||

StuporMan:

I am able to execute all the Select, Update, Insert statements that I wish to, and when I copy the statement into the SQL 2005 Management studio query menu it works perfectly, it just gives the error message from the ASP.net page.

I've tried to run your command in SQL Server Management Studio:

Create View TestView as Select 1, 2

and it generates this error message:

Msg 4511, Level 16, State 1, Procedure TestView, Line 1
Create View or Function failed because no column name was specified for column 1.

|||

Ok, I had mistyped the SQL I was using as I had to do it from memoryat the time. Here is a valid Create View statement that produces thesame error in ASP.net:

"Create View TestView as Select 1 as test1, 2 as test2"

This should run in SQL Management studio. If it does not try"Create View TestView as Select * from <insert table name here>",which should also be valid. In either case, ASP.net should produce thesame error message.

Thanks,

StuporMan

|||

I am still having problems even after correcting the SQL string.Tryany valid CREATE VIEW statement from ASP.net and see if it will work. Ihave not been able to get any to work to date.

|||Presumably whatever context your web application is under doesn't have the needed security. Are you sure you elevated the permissions of the correct account? (Just guessing here, as I've never tried creating views from a web application myself.)|||

Thanks for the response, you prompted me to again check mypermissions. The user I was logging into the SQL server with DIDhave the correct permission set. The ASPNET user did not. Giving ASPNETthe permission did the trick.

Thanks,

StuporMan

Wednesday, March 21, 2012

Creating a snapshot for merge replication

I'm trying to test merge replication, but am unable to create the publication, the snapshot agent keeps failing. The error I get from replication monitor is "Script failed for Table <tablename>"

Our database has quite a few XML datatype columns, when I take out the xml columns the snapshot succeeds OK, but fails with the xml column.

I created a simple table containing a varchar column and xml column. I created this table in our database, and in Adventure Works. Was able to create a publication with this test table in the adventureworks database, but was unable to create publication with this table in our database. The snapshot failed with error "Script failed for table testtable". I removed the xml column on the test table in our database and was able to create the publication successfully. Creating a publication in the adventureworks database with an xml column has no problems, but does in our database.

Anyone have any ideas?

Hi|||

Hi

What is the name of the database you are creating the publication in?

Can you post a script for the xml schema collection you are trying to publish?

Thanks

|||

Hi Katie,

I suspect that the compatibility level of your database is set to <90, and you can find out whether this is the case by executing sp_dbcmptlevel with the name of your database. If the compatibility level of your database is indeed set to < 90, you can use sp_dbcmptlevel again to change it to 90 and see if the snapshot problem goes away.

Hope that helps.

-Raymond

Creating a report using a stored procedure

Hi All,

Is there a way to create a report in SQL2005 reporting services to call a stored procedure that has parameters? I keep getting an error saying i am not supplying the params, I can't seem to find where to put my parameters for the report to use.

Thanks, Joe

You would be better posting this on the reporting services forum, as this is mainly for T-SQL issues

Creating a report using a Stored Procedure

Hi All,

Is there a way to create a report in SQL2005 reporting services to call a stored procedure that has parameters? I keep getting an error saying i am not supplying the params, I can't seem to find where to put my parameters for the report to use.

Thanks,

Joe

How about something like

exec uspTest @.parm1, @.parm2

If I remember right it will provide a couple of boxes for you to type the parm values when you view the report in Report Manager

|||the parameters (Report Parameters) you have in RS should have the same name as the parameters you declare in stored procedure.sql

Monday, March 19, 2012

Creating a relationship

I am very new to SQL Server and to S.S. 2005. I am trying to create a relationship using a database diagram. I keep getting this error:

'tblCASEMAST' table saved successfully
'tblCASECHRG' table
- Unable to create relationship 'FK_tblCASECHRG_tblCASEMAST'.
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_tblCASECHRG_tblCASEMAST". The conflict occurred in database "Criminal Records", table "dbo.tblCASEMAST", column 'CASENO'.

In tblCASEMAST, CASENO is nvarchar, length of 12 and a primary key

In tblCASECHRG, the column I am trying to link to is also nvarchar, length of 12

Any help is appreciated.

I found the solution. I had to delete the data, create the relationship and then import the data again.

Creating a Proxy Account

I am trying to run SSIS packages under SQL Server Agent 2005 and I keep getting a package failed error in the event viewer.

I've heard that I need to set up a proxy account. I have found the following code and need a little explanation on what all the parts mean since I am very new to this:

Use master

CREATE CREDENTIAL [MyCredential] WITH IDENTITY = 'yourdomain\myWindowAccount', secret = 'WindowLoginPassword'

Use msdb

Sp_add_proxy @.proxy_name='MyProxy', @.credential_name='MyCredential'

Sp_grant_login_to_proxy @.login_name=' devlogin', @.proxy_name='MyProxy'

Sp_grant_proxy_to_subsystem @.proxy_name='MyProxy', @.subsystem_name='SSIS'

Let's say for the sake of argument my domain is called CompanyInc and I log into windows with my name Philip_Jaques and my password is badpassw0rd. Would I modify the above code this way to create my proxy?

Use master

CREATE CREDENTIAL [MyCredential] WITH IDENTITY = 'CompanyInc\Philip_Jaques', secret = 'badpassw0rd'

Use msdb

Sp_add_proxy @.proxy_name='MyProxy', @.credential_name='MyCredential'

Sp_grant_login_to_proxy @.login_name='Philip_Jaques', @.proxy_name='MyProxy'

Sp_grant_proxy_to_subsystem @.proxy_name='MyProxy', @.subsystem_name='SSIS'

Also, when I create this proxy account where in SQL Server 2005 can I go to view it and its properties? And assuming I get the proxy account set up correctly, how do I get my current jobs to start using it so they will successfully run?

Thanks in advance for your help and advice!

I've never heard of having to create a proxy to get SqlAgent to run SSIS accounts. Sql Agent should be setup to run under a service account already, and will run SSIS packages no problem. Where did you find this information?|||

This article pretty much explains my problem:

http://support.microsoft.com/default.aspx/kb/918760

Creating a Param Subscription

When i attempt to create a new e-mail subscription to a report i get
the following error message:
"Subscriptions cannot be created because the credentials used to run
the report are not stored, the report is using user-defined parameter
values, or if a linked report, the link is no longer valid."
I have attempted everything to get this resolved. It works when i try
subscribing to a report that does not use any parameters. The
credentials are "stored securely in the report server" and i have the
default values set for my two parameters.
How do i get around this message in order to create a subscription?Does the report use the User object? If so then you can not subscribe to
it.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"muris" <rmuris@.hotmail.com> wrote in message
news:1114004323.057963.57760@.f14g2000cwb.googlegroups.com...
> When i attempt to create a new e-mail subscription to a report i get
> the following error message:
> "Subscriptions cannot be created because the credentials used to run
> the report are not stored, the report is using user-defined parameter
> values, or if a linked report, the link is no longer valid."
> I have attempted everything to get this resolved. It works when i try
> subscribing to a report that does not use any parameters. The
> credentials are "stored securely in the report server" and i have the
> default values set for my two parameters.
> How do i get around this message in order to create a subscription?
>|||I do not use the User Object.

Saturday, February 25, 2012

creating a database in SQL 2005 - using windows 2003

when i try to create a new database i get a error: The server could not
load DCOM

what is wrong and how can i fix it?

i have updated mssql/win 2003 with the lates updates

Rgds

BobbyHi Bobby

This usually has something to do with user permissions. Please ensure
that your database login has permissions to create new databases. Also
ensure that you have sufficient Windows user permissions to the
directory where SQL Server is trying to create the .mdf and the .ldf
file.

Cheers
Louis

Friday, February 24, 2012

Creating a CSV file but cant read it.

Hi, I wrote a report builder that creates a CSV file but I can't redirect to the file to view it. ERROR Cannot find the Server!. This works fine on the dev machine but deploy it and it does not.

Dim Conn As New SqlConnection(ConfigurationSettings.AppSettings("ConStr"))
Dim Cm As SqlCommand
Dim dr As SqlDataReader
Dim FileName As String = Guid.NewGuid.ToString & ".csv"
Dim FilePath As String = Server.MapPath("") & "\CSVFiles\" & FileName

Dim fs As FileStream = New FileStream(FilePath, FileMode.Create, FileAccess.Write)
Dim sw As StreamWriter = New StreamWriter(fs)
Dim Line As String
Dim lItem As System.Xml.XmlElement
Dim i As Int16
If ValidatePage() Then
Cm = New SqlCommand(BuildQuery, Conn)
Conn.Open()
dr = Cm.ExecuteReader()

Dim lXmlDoc As New System.Xml.XmlDocument()
lXmlDoc.LoadXml(txtHXml.InnerText)

For Each lItem In lXmlDoc.DocumentElement.SelectSingleNode("SELECT").ChildNodes
Select Case lItem.InnerText
Case "chkPRId"
Line &= "PR Id,"
Case "chkDateIssued"
Line &= "Date Issued,"
Case "chkOriginator"
Line &= "Originator,"
Case "chkBuyer"
Line &= "Buyer,"
Case "chkVendor"
Line &= "Vendor,"
Case "chkCostCode"
Line &= "Cost Code,"
Case "chkOracleRef"
Line &= "Oracle Reference,"
Case "chkTotal"
Line &= "Total,"
End Select
Next
Line = Line.Substring(0, Line.Length - 1)
sw.WriteLine(Line)

Line = ""
While dr.Read
For i = 0 To dr.FieldCount - 1
Line = Line & dr(i) & ","
Next
sw.WriteLine(Line)
Line = ""
End While

dr.Close()
Conn.Close()
sw.Close()
fs.Close()
Response.Redirect(FilePath)
End If
ResetPage()
PopulateListBoxFromXML()Have you checked that the file path resolves as expected. At least in C# backslashes in a file path get escaped to some other charcter. Try either:


Dim FilePath As String = Server.MapPath("") & "\\CSVFiles\\" & FileName
or

Dim FilePath As String = Server.MapPath("") & @."\CSVFiles\" & FileName

Creating a Connection

I am trying to connect to a database on an MS Sql server, I typed the code exactly like what is shown in the tutorial and I keep getting an error... (Error in line 6)

Line 4: Dim oODBCConnection As OdbcConnection
Line 5: Dim sConnString As String = _
Line 6: "Driver={SQL Server};" &_
Line 7: "Server=209.151.130.8;" &_
Line 8: "Database=blah;" &_
...(Error in line 6)

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30203: Identifier expected.First off - I'd say you're going in the wrong direction, since it looks as if you're trying to connect with a SQL server - -
ASP.Net has a namespace that talks directly to SQL Server...
it should look more like the info in :
Database Connect and Display Samples

Which tutorial are you reading?|||I've been using Classic ASP untill now, I'm moving on up to .NET...

I'm looking for a very simple way to retreave some data from a database and display it using of of the data web controls..

The part that I'm having trouble with is comunicating with the server (creating a connection)..

On The Side:
I've read about placing the connection string in the AppSettings section in web.config, but this isn't going to work in my case because I am only working with a single aspx file... Am I correct in saying that this way won't work because I'm using only one aspx file..|||Ps: I changed the ip, and user name for security reasons...

<% @.Import Namespace="System.Data.SqlClient" %>
<% @.Import Namespace="System.Data" %>
<script language="vb" runat="server" debug="true"
Sub Page_Load(Source as Object, E as EventArgs)
Dim strConn as string = "server=555.555.11.11;uid=test;pwd=test1;database=webland"
Dim MySQL as string = "Select pl_username From Users"
Dim MyConn as New SQLConnection(strConn)
Dim ds as DataSet=New DataSet()
Dim Cmd as New SQLDataAdapter(MySQL,MyConn)
Cmd.Fill(ds,"Customers")
myDataList.Datasource=ds.Tables("users").DefaultView
myDataList.DataBind()
End Sub

</script
<asp:DataList runat="server" id="myDataList"
Width="85%" Border="1"
HorizontalAlign="Center"
Font-Name="Verdana" CellPadding="4"
Font-Size="10pt"
RepeatColumns="5" >
<ItemTemplate>
Question:<br />
<%# DataBinder.Eval(Container.DataItem, "pl_username") %>
</ItemTemplate>
</asp:DataList
ERROR:
Cannot open database requested in login 'webland'. Login fails. Login failed for user 'test'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open database requested in login 'webland'. Login fails. Login failed for user 'test'.

BUT:
I bleave that my user name information that I provided is correct..I think taht something else is causing the error, but i'm not getting the correct error message?|||It is very possible that wherever this database resides, that they are not using the standard sql port 1433. A lot of places are doing this now for security by obscurity reasons. Anyway, if you don't know for sure, I would contact the people who host your website and make sure that you have the right port. If it is a different port just add a comma and the port number after the server address. For example if you find out that the port number is 1435, then instead of this:

Dim strConn as string="server=555.555.11.11;uid=test;pwd=test1;database=webland"

try this:

Dim strConn as string="server=555.555.11.11,1435;uid=test;pwd=test1;database=webland"

Sunday, February 19, 2012

CreateSubscription Error

I am trying to create an email subscription programmatically, so I first followed the BOL example which worked ok.
Later I tried to replace the fixed ExtensionParams array of the example with a call to the web service method GetExtensionSettings, where, for the desired delivery extension, a parameter array would first be dynamically filled with the required parameter names by the web service and then I would only have to supply the respective parameter values.
After that change, the call to the method CreateSubscription does not work, as it doesnt recognize a SendEmailToUserAlias=True parameter which is now also used for the call.
Why is that?Some properties returned by the GetExtensionSettings method are marked as
read-only and can not be passed back in during CreateSubscription calls.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"vsiat" <vsiat@.discussions.microsoft.com> wrote in message
news:853377AF-B0DC-477A-AD28-9507DC2559D8@.microsoft.com...
> I am trying to create an email subscription programmatically, so I first
followed the BOL example which worked ok.
> Later I tried to replace the fixed ExtensionParams array of the example
with a call to the web service method GetExtensionSettings, where, for the
desired delivery extension, a parameter array would first be dynamically
filled with the required parameter names by the web service and then I would
only have to supply the respective parameter values.
> After that change, the call to the method CreateSubscription does not
work, as it doesnt recognize a SendEmailToUserAlias=True parameter which is
now also used for the call.
> Why is that?
>

CreateReport() method under ASP.NET

CreateReport throws an error saying that user IUSR_XXXXX doesn't have
permisssions to run this method.
So,
1) I went to ReportServices roles and anded a new group for IUSR_XXXXX
user
2) Assigned ReportserverSysadmin role for the new group.
3) Also set db_owner permissions for the IUSR_XXXXX user in
ReportService
related databases on
my local instance of MS SQL.
No results. Still can't call method CreateReport().
Any ideas ?
Thanks
Paul
PS. BTW this method works fine from *.rss script that is running under
local Admin account.There can be a few reasons that most likely cause this:
1. You have anonymous authentication enabled for "Reports" and
"ReportSerever" virtual folders. Go to IIS manager and make sure anonymous
access is disabled.
2. You are calling this method from within an ASP.NET application that
doesn't impersonate its user. It calls CreateReport using its own identity.
--
Dmitry Vasilevsky, SQL Server Reporting Services Developer
This posting is provided "AS IS" with no warranties, and confers no rights.
--
---
"pTsy" <ptsygura@.bna.com> wrote in message
news:#pDOs2veEHA.2916@.TK2MSFTNGP12.phx.gbl...
> CreateReport throws an error saying that user IUSR_XXXXX doesn't have
> permisssions to run this method.
> So,
> 1) I went to ReportServices roles and anded a new group for IUSR_XXXXX
> user
> 2) Assigned ReportserverSysadmin role for the new group.
> 3) Also set db_owner permissions for the IUSR_XXXXX user in
> ReportService
> related databases on
> my local instance of MS SQL.
> No results. Still can't call method CreateReport().
> Any ideas ?
> Thanks
> Paul
> PS. BTW this method works fine from *.rss script that is running under
> local Admin account.
>

CreateMHTMLBody retuns "Invalid syntax" error

Hi,

I want to add html as body of my mail message. I added CreateMHTMLBody method in my SQL code.

Syntax I used is

Exec @.hr=sp_oamethod @.imsg,'CreateMHTMLBody',NULL,@.MsgFile,0,'',''

This syntax is working fine on my system but whem I implement this on production it gives error.

Needed ASAP as I have to implmenet this on my production server today.

Thanks

GAurav

What is the error message you are getting|||are you running the same version of cdosys.dll on dev and prod?|||

Why use CDO when you have sql database mail.

CreateMHTMLBody expects 4 parameters (url, cdomhtmlflags, user, pwd) so check your @.MsgFile.

|||Check the required COM DLLs are registered properly on your server.|||

Using SQL database mail you can't send the HTML mails where message body is created from the HTML file

And my syntax is correct as it is working perfectly fine on my development env. but it is not working on production

|||

Yes COM dll is properly registerde and it is sending Textbody mail. But when I use this CreateMHTMLBoby it gives me above error. And my code and syntax is also correct as it is working fine on development env.

Thanks

Friday, February 17, 2012

CreateFile() Error

I am using SQL 7.0 to establish connection with my ISP SQL ,using the correct UserName/Password given by my ISP.However I encounter this error message and my ISP technical support say that no problem with the server.

Error Source:Microsoft OLE DB Provider for SQL Server

Error Description:Client unable to establish connection [DBNMPNTW]ConnectionOpen [CreateFile()]

Please help me with this.Go to you SQL Server Network Utility and change protocol type to TCP/IP.|||Thanks EdwardP.Problem solved!!!
But how about this error,?

[DBMSSOCN] General netwprk error?

Umm ,is it cause by my computer setting that do not join the domain?

CreateFile() Error

I am using SQL 7.0 to establish connection with my ISP SQL ,using the correct UserName/Password given by my ISP.However I encounter this error message and my ISP technical support say that no problem with the server.

Error Source:Microsoft OLE DB Provider for SQL Server

Error Description:Client unable to establish connection [DBNMPNTW]ConnectionOpen [CreateFile()]

Please help me with this.

*Note* connect through internetWhen you say you are using sql server 7 to connect - are you using enterprise manager or query analyzer ? If so, have you tried both.|||I am using enterprise manager ,DTS import wizard.|||Are you saying you can connect to enterprise manager but when you use the dts import wizard you receive this error ? Is the sql server running where on the isp side - and this sql server is version 7 ? If you can connect to enterprise manager ok, can you access tables ... ?

Create/Alter view with declare variable

Hi all,

I not sure whether is there a way to create/alter a view with variable declare in the same statement. I encounter some error when I run the below statement.

Error:

Server: Msg 156, Level 15, State 1, Procedure Employee_Details , Line 2
Incorrect syntax near the keyword 'DECLARE'.
Server: Msg 170, Level 15, State 1, Procedure Employee_Details , Line 16
Line 16: Incorrect syntax near ')'.

My SQL Statement

ALTER VIEW Employee_Details as (
DECLARE @.usr nvarchar(250)
SET @.usr = user
SELECT
E.ID
,E.NAME
,E.DEPARTMENT
,E.JOB_TITLE
,E.JOIN_DATE
,E.RESIGN_DATE
FROM
EMPLOYEE AS E
WHERE
E.DEPARTMENT = (SELECT *
FROM GETCURRENTUSER(@.usr))
)

The GetCurrentUser is a function I have create to get the department that the user can view.

Please advice. Thanks in advance.

Hello,

You cannot declare variables in view defiunitions. You can either create your logic in a procedure or modify your view to make use of the in-built user_name() function in order to return filtered results.

Cheers,
Rob

|||

Hi Rob,

Yes, I have try to use another way of doing and I think I have solve the problem.

Really thanks for your advice, it does give me another idea of doing this.