Showing posts with label trouble. Show all posts
Showing posts with label trouble. Show all posts

Thursday, March 22, 2012

Cant access sql express stored procedure..help!

Hi everyone, im having alot of trouble trying to execute a stored proc from sql express. heres my code

DbProviderFactory db =DbProviderFactories.GetFactory("System.Data.SqlClient");

using(DbConnection conn = db.CreateConnection()){

ConnectionStringSettings s =ConfigurationManager.ConnectionStrings["constrolservicetest"];

conn.ConnectionString = s.ConnectionString;

conn.Open();

DbCommand cmd = conn.CreateCommand();

cmd.CommandText ="StoredProcedure1";

cmd.CommandType =CommandType.StoredProcedure;

DbParameter param = db.CreateParameter();

param.ParameterName ="@.test";

param.Value = 2;

cmd.Parameters.Add(param);

cmd.ExecuteNonQuery();

}

****************************procedure code***************************

Create PROCEDUREdbo.StoredProcedure1

(

@.testint

)

AS

Update temp

Settest = @.test

******************************************************************

The code just doesn't update. I know my connection string is correct because i got the datareader to work, but i just cant get the stored proc to call. Any help will be greatly appreciated.

Thanks,

-D

That code looks reasonable to me. Are you sure it's being called?

Sunday, March 11, 2012

Cannot use the special principal 'sa'

Hello,

I am starting to use SQL Server 2005. I am having trouble connecting remotely. I tried to enable the 'sa' user and got this error:

Cannot use the special principal 'sa'

Is the 'sa' user no longer valid for remote connections?

Thank you

Did you enable "Mixed Mode" authentication? If you use Windows authentication, sa is disabled by default.

Sung

|||

How did you try to "enable" sa? What statement did you execute to get that error?

Thanks
Laurentiu

|||

Thank you for your reply.

Yes, I did enable Windows authentication, but when I could not connect remotely I decided to to try and connect using SQL authentication. Can I change the authentication mode?

Thank you

|||

Yes, you can change the authentication mode: go to Management Studio and open Object Explorer. Connect to your server and right-click on the server name, then select Properties. Go to Security tab and under Server Authentication select SQL Server and Windows Authentication Mode.

Thanks
Laurentiu

|||

Also, after you follow the directions above, you will also need to explicitly enable the sa account as well. In the same place as before, go to Security->Logins. Right-click on the "sa" account, select "Properties". In the list on the left, select "Status" and under "Login" on the right, make sure "Enable" is selected.

[edit] - nevermind, looks like you got it working :)

Sung

|||

I found the steps to change the authentication.

Now I can login remotely.

Thank you

Friday, February 24, 2012

Cannot shrink log file more than 2GB in small database

Hi2all,
I have some trouble with shrinking log file. No more user is connected
on this database. According to dbcc loginfo command log file is just
made up with active log. Here is the result
FileId_FileSize_____ StartOffset FSeqNo Status
Parity CreateLSN
2 1186201600 8192 15 2 128 0
2 1186201600 1186209792 16
2 64 0
I don't know why it remains so much space in active log because no
transaction is applied.
Can someone help me ?
Mo
--
Mo
Posted via http://dbforums.comSee
http://support.microsoft.com/default.aspx?scid=kb;en-
us;272318
http://support.microsoft.com/default.aspx?scid=kb;en-
us;256650
(and the references at the botom)
Do you have the database in full recovery mode and are you
taking log backups
If yes and no then set it to simple and read about backup
strategies in bol.

Friday, February 10, 2012

Cannot restore database

I have a couple of sql servers 2000 enterprise edition, that are giving me
trouble when I want to restore some databases. The server reports that the
database is in use but when I check using sp_who the specific databases are
not in use. The problem is solved when the server is stopped and restrated,
but I cannot imagine that this is the solution.
One server is an enterprise edition sp3
the other is a virtual server part of a win2000 cluster also sp3.
any ideas?
Thanks.
Ahmad El-Kays
Systems Developer
Maritz Canada Inc.
elkaysaz@.maritz.com
aelkays@.hotmail.comHow are you performing the restore? Via Query Analyzer or
Enterprise Manager?
In QA, make sure that you are not in the database your are
trying to restore. This is seen by the pull down menu. You
should choose to be in the master database.
In EM, do not select the database you are restoring. You
can right click on 'database' without expanding the tree
or expand the tree and right click on the master database
and choose to do the restore.
HTH
DeeJay
>--Original Message--
>I have a couple of sql servers 2000 enterprise edition,
that are giving me
>trouble when I want to restore some databases. The server
reports that the
>database is in use but when I check using sp_who the
specific databases are
>not in use. The problem is solved when the server is
stopped and restrated,
>but I cannot imagine that this is the solution.
>One server is an enterprise edition sp3
>the other is a virtual server part of a win2000 cluster
also sp3.
>any ideas?
>Thanks.
>
>Ahmad El-Kays
>Systems Developer
>Maritz Canada Inc.
>elkaysaz@.maritz.com
>aelkays@.hotmail.com
>
>.
>|||This is not the case. The database is not used at all. when sp_who is run
the database does not show up in the list at all. and YES the restore is
done in QA in the master db!
"DeeJay Puar" <deejaypuar@.yahoo.com> wrote in message
news:0dad01c368bc$d3b0b720$a301280a@.phx.gbl...
> How are you performing the restore? Via Query Analyzer or
> Enterprise Manager?
> In QA, make sure that you are not in the database your are
> trying to restore. This is seen by the pull down menu. You
> should choose to be in the master database.
> In EM, do not select the database you are restoring. You
> can right click on 'database' without expanding the tree
> or expand the tree and right click on the master database
> and choose to do the restore.
> HTH
> DeeJay
> >--Original Message--
> >I have a couple of sql servers 2000 enterprise edition,
> that are giving me
> >trouble when I want to restore some databases. The server
> reports that the
> >database is in use but when I check using sp_who the
> specific databases are
> >not in use. The problem is solved when the server is
> stopped and restrated,
> >but I cannot imagine that this is the solution.
> >
> >One server is an enterprise edition sp3
> >the other is a virtual server part of a win2000 cluster
> also sp3.
> >
> >any ideas?
> >
> >Thanks.
> >
> >
> >Ahmad El-Kays
> >Systems Developer
> >Maritz Canada Inc.
> >elkaysaz@.maritz.com
> >aelkays@.hotmail.com
> >
> >
> >.
> >