Showing posts with label heyi. Show all posts
Showing posts with label heyi. Show all posts

Sunday, February 19, 2012

Can't login into SQL Server Database

Hey
I get the following error when trying to connect to my named instance Sql
Server running locally on my laptop. Does anyone know how to resolve this
I get the following error : Login failed for user:acw
Here is my code:
SqlConnection sConn = new SqlConnection(server=ACLAPTOP\ACSQLSERVE
R;User
id=acw; Password=;Database=BookSpot);
Thanks,
AlAl
Open QA and try to log in with the user. Do you get the same error?
"Al Wilkerson" <ac527@.comcast.net> wrote in message
news:7aCdnUdO-Ipm37zfRVn-gA@.comcast.com...
> Hey
> I get the following error when trying to connect to my named instance Sql
> Server running locally on my laptop. Does anyone know how to resolve this
> I get the following error : Login failed for user:acw
> Here is my code:
> SqlConnection sConn = new SqlConnection(server=ACLAPTOP\ACSQLSERVE
R;User
> id=acw; Password=;Database=BookSpot);
>
> Thanks,
> --
> Al
>|||I assume this is C# code. Did you give this user a blank password?
Double-check the password for this user and the rights/roles granted to this
user in EM. I assume your connection string is properly quoted (or it
wouldn't even compile for you). Finally, are you using Integrated Security
or SQL Server Authentication?
Thx
Mike C.
"Al Wilkerson" <ac527@.comcast.net> wrote in message
news:7aCdnUdO-Ipm37zfRVn-gA@.comcast.com...
> Hey
> I get the following error when trying to connect to my named instance Sql
> Server running locally on my laptop. Does anyone know how to resolve this
> I get the following error : Login failed for user:acw
> Here is my code:
> SqlConnection sConn = new SqlConnection(server=ACLAPTOP\ACSQLSERVE
R;User
> id=acw; Password=;Database=BookSpot);
>
> Thanks,
> --
> Al
>

Sunday, February 12, 2012

cant increase column size

hey

i've a db running sql server express sp2. the db size now is 1.1 gb
i've a table with a varchar column of size 20 . when i try to increase the column size to 50 i get a
timeout exception, and the the cloumn size is unchanged. this table has 2.5 million records

i use sql server management studio express to do the changes

is there a way to increase this timeout or whtever i can do to update this column size?

thx in advance

I am guessing you are using ssms and the GUI to edit this column. There are occasions when you use the GUI that sql server doesn't choose the most efficient way of executing a task. In this instance, i would hazard a guess that it will be creating a temp table with the new schema and then dumping the records in to it before dropping your table and renaming the new temp one to the original one. (stay with me!!)

If you just try,

ALTER TABLE tbl
ALTER COLUMN col1 VARCHAR(50)

Hopefully, that will be quicker.

|||well strangely thats actually works
weird how the gui can be soo stupid in such a simple task

thx man
|||

There is subtle difference doing this task from GUI and from T-SQL.


From T-SQL:


It alters the existing table to modify that column alone.


From GUI:


1) Creates a new tmp table with the new structure and inserts the data from the table you are modifying with insert select clause.


2) Drops the table you are modifying.


3) Renames the new tmp table to the old table's name.


You could see this for yourself if you turn on SQL Profiler and try to modify the table with T-SQL and from GUI.