|
Seems that you did not install management studio.
Visit http://msdn2.microsoft.com/en-us/express/bb410792.aspx[^] and download "SQL Server Management Studio Express" and install it.
Or download the full package "Server 2005 Express Edition with Advanced Services" and the toolkit.
|
|
|
|
|
Thank you very much.
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
Good Day Again,
I am using C# and I only want to add distinct items into my table.
I know there are many ways to do this like:
1. Using select, check if there is any item using the same ID code.
But is there any way to do this with a single command?
Or I need to change something in my TABLE SETTINGS to tell it not to allow non-distinct items?
Regards,
SQL NEWB
|
|
|
|
|
|
Hi Giorgi,
Sorry for not including the dbms. It's Microsoft SQL Server 2005 Express.
Thanks.
|
|
|
|
|
Good Day Sir/Maam,
I am new with installing MS SQL Express Edition.
So I did install MS SQL Server 2005 Express Edition on my home PC. Everything went fine. I have made a program in C# with ADO.NET and everything seems to work fine.
Now, I want to have a username and password when connecting to a data source. How can I do this? I mean, Where is the settings for that?
Thank You.
|
|
|
|
|
See the following site[^] for details on how to create different connection strings. You should use something like this:
Data Source=myServerAddress; Initial Catalog=myDataBase; User Id=myUsername; Password=myPassword;
Paul Marfleet
|
|
|
|
|
Thanks for the reply, Paul.
I already know the connection string. What I am inquiring for is how to make my SQL Server run on SQL Authentication with username and password.
Thanks.
|
|
|
|
|
Use the CREATE LOGIN[^] and CREATE USER[^] statements to create a new SQL login and grant it access to a database.
For example:
USE master
GO
-- Create database login
CREATE LOGIN Paul WITH PASSWORD='p@ssw0rd1'
USE myDB
GO
-- Assign login rights to access myDB
CREATE USER Paul FOR LOGIN Paul
You can do the same thing through the Management Studio UI.
Hope this helps.
Paul Marfleet
|
|
|
|
|
Thanks Paul. Solved it. Gave a 5.
|
|
|
|
|
Hi all ,
I created a Login in sql server 2005 and set its permissions and created a user mapped to it , I have a .net app that connects to this database , How should I deploy this database with my .net app that is going to run server-based ? When using Windows Authentication Mode , to which Login should I set permissions? Should I write a script for setting these permissions?
Thanks
|
|
|
|
|
Depends on the version of windows, IIS you use.
For XP+IIS 5.0 you should add a windows login for ASPNET account
for Win2003+IIS 6.0 you should use NETWORK SERVICE user.
You can generate a SQL Script of your database and run it with the installation package to create DB and users.
|
|
|
|
|
Hi All,
I have a problem with my SQL Server 2000, it seems that when 50 users where using my application at some point of time the cpu utilization of sqlserver goes to 100% and it comes down after some time. it happens at regular intervals.
Any help plz. Thankz in advance...............
Bala
-- modified at 11:41 Saturday 13th October, 2007
|
|
|
|
|
Hi All,
I havnt got any response from CodeProject, but I have solved the issue myself. I tried creating Clustered And Non-Clustered Index into a table (Important table that appears in most transactions).
Also i have created some Maintenance paln that executes DBCC commands automatically.
Bala
|
|
|
|
|
hi,
i have a very simple problem....i have a ms access database. I have a windows form, which has two textboxes(name and depid) and a combobox(department),i want to write a query that will search all these using WHERE and LIKE.ie i need to create a function by the name search and use the query so that this will search all these...i am new to sql...expecting your help
Thanks in advance,
JAN
|
|
|
|
|
select * from <tableName> where name ='deptname' and depid='1' <br />
-- instead value 1 on depid set another id
for more help describe your problem much more.
I Love SQL
|
|
|
|
|
hi,
i have three layers.
1)form.cs
2)datalayer
3)database(forget about this since it is used to open and close the connections form the ms access)
i have two text and a single combobox.
basic idea is i want a query that will search even if any one of these fields are selected.
also do the same if two are selected.
also do the same if one is selected.
the code to search will have to be on my btn click for serach event(ie is in layer form1.cs).
it will have to call my query that will be in a fn: that is in datalayer ( public DataTable refinesearch(string searchstr1, string s2, string s3)
so i think i need to use "like" condition.
something like
"select * from Employee(name of the table) where name like "string" where empid like "s2" etc........
this is my problem .i do not know the query.
thanking you and expecting your reply....
J
|
|
|
|
|
if datatype of column EmpId is integer then you can not use like statement just
>,<,=,<> but if column EmpId is varchar then you can use like statement
--if empid is integer
select * from Employee where name like '%string%' and empid=1
--if empid is varchar
select * from Employee where name like '%string%' and empid like '%1%'
-- modified at 11:38 Saturday 13th October, 2007
I Love SQL
|
|
|
|
|
Hi,
Thankyou Blue_Boy .it worked fine.
Thanks a lot for your time....
Regards
Jan
|
|
|
|
|
You are welcomed.
I Love SQL
|
|
|
|
|
Guys im having a problem with this statement..
ALTER TABLE tblSample
ADD SampleField nvarchar (30) NOT NULL
CONSTRAINT SampleField PRIMARY KEY
im just trying to set my newly added column and at the same time setting it as a primary key.. but it wont work..
Is there any other way?
or can it set an existing non primary column to a primary one.. if it can then how.. thanks..
|
|
|
|
|
Widgets wrote: but it wont work..
Please supply error messages etc as "won't work" is an interpretation and not an observation of what actually happened.
Have you checked that SampleField contains unique values?
Primary keys can only be assigned to columns with unique values.
You always pass failure on the way to success.
|
|
|
|
|
Several problems:
- You haven't specified a default value for SampleField and have disallowed NULLs so the database doesn't know what value to give that field for existing rows in the table (it would normally use NULL but you've disallowed it);
- Even when you do add a default value or allow NULLs primary keys must be built on unique values, and every row in the table will then have the same value in that column;
- The SQL syntax for ALTER TABLE doesn't allow you to do both at the same time anyway;
- The SQL syntax for adding a primary key is:
ALTER TABLE tblSample
ADD CONSTRAINT PK_tblSample PRIMARY KEY
( SampleField ) PK_tblSample is the name I've given to the constraint, which you need if you later want to drop it. If using CREATE TABLE, you can set the primary key to a single column simply by stating PRIMARY KEY after the column definition, but the name is generated by SQL Server making it harder to use later.
You can define a primary key on a table that doesn't already have one by using the syntax above. You can create compound keys - keys consisting of multiple column values - by including all the key columns between the parentheses.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
thanks guy i really appreaciate your help..
|
|
|
|
|
hey how do i filter rows in a datagridview which have its datasource from a dataset?
the situation is like this:
I use c# , i got a dataset which contains a full table from my database , and i want to view on the datagridview a filtered table which result by the table.select() method, or maybe with other similar method , i couldnt manage to do that :/ i dont know how to view the viltered results only the full table , please help on the subject any help will be great , thanks in advance to all!
Net
|
|
|
|