|
I used this command to create SQL Server login:
EXEC sp_addlogin 'Mazdak','password'
When I want to login to query analyzer I got this error:
---------------------------
SQL Query Analyzer
---------------------------
Unable to connect to server MAZY:
Server: Msg 18452, Level 16, State 1
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'Mazdak'. Reason: Not associated with a trusted SQL Server connection.
---------------------------
OK
---------------------------
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
sp_AddLogin creates a SQL Server login. You are trying to connect with a Windows login.- To connect using SQL Server authentication, select the "SQL Server authentication" option and enter the username and password;
- To add your NT account to SQL Server, use
sp_GrantLogin , e.g. EXEC sp_GrantLogin 'MAZY\Mazdak'
|
|
|
|
|
Thank you.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
hey im trying to make a database app with the MFC wizard in c++ 6, when i add a Datagrid control, there are two columns by default, how can i add more columns to it? there is no option to do this in the properties. Can anyone tell me how to add more?
|
|
|
|
|
Sorry for cross-post... realized this is the more appropriate group after I sent the first one:
I've created a strongly typed dataset but whenever I try to select rows from
a table and try to cast the rows, I'm getting an error "Specified cast is
not valid.".
I have a table named "Inventory". I'm able to select rows and place them in
a variable with type DataRow[]. However, when I try to cast it to a
InventoryRow, I get errors every time.
Here's the code: my dataset name is PADS...
working code:
DataRow[] recordArray = this._dataSet.Inventory.Select();
error code:
<br />
PADS.InventoryRow[] recordArray =<br />
(PADS.InventoryRow[])this._dataSet.Inventory.Select();<br />
I'm certain I'm using the correct variable names because I'm able to easily
create new records with the following:
<br />
PADS.InventoryRow record = this._dataSet.Inventory.NewInventoryRow();<br />
this._dataSet.Inventory.AddInventoryRow(record);<br />
Any input would be greatly appreciated!
Andrew Connell, MCDBA
IM on MSN
andrew@aconnell.com
Andrew Connell, MCDBA
IM on MSN
andrew@aconnell.com
|
|
|
|
|
does InventoryRow directly inherit from DataRow? if not there might be problems casting it
|
|
|
|
|
I'm having some trouble creating an index with ADOX (against MSJet as the provider).
For the life of me, I can't figure out how to make the index *unique*. Sure, there is a pIndex->PutUnique() function on the Index object, but it doesn't seem to work, since the resulting database still lists the field as "duplicates OK" when I open it in Access.
I've also tried 'pIndex->Properties("Unique")->PutValue(true)', but that only results in an exception being thrown (with some unhelpful error message). But PutValue(false) doesn't result in an error. Am I missing some prerequisites for a unique index?
If I change the index in Access to "no duplicates" and reopen the database, both the pIndex->GetUnique() and Properties("Unique")->GetValue() return true.
Any help is much appreciated.
|
|
|
|
|
Whats wrong with this:
use master
GO
CREATE DATABASE mydb3 ON FILEGROUP myfilegroup
( NAME=mydb3Data,
FILENAME='f:\mydb3Data.mdf',
SIZE=2MB,
MAXSIZE=10MB,
FILEGROWTH=1MB)
LOG ON
(NAME=mydb3Log,
FILENAME='f:\mydb3Log.mlf',
SIZE=1MB,
MAXSIZE=4MB,
FILEGROWTH=1MB)
GO
Error:
Line 1: Incorrect syntax near 'FILEGROUP'
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Hi,
Try the following query.........
use master
GO
CREATE DATABASE mydb3 ON PRIMARY
( NAME=mydb3Data,
FILENAME='f:\mydb3Data.mdf',
SIZE=2MB,
MAXSIZE=10MB,
FILEGROWTH=1MB)
LOG ON
(NAME=mydb3Log,
FILENAME='f:\mydb3Log.mlf',
SIZE=1MB,
MAXSIZE=4MB,
FILEGROWTH=1MB)
GO
Ravi Shankar S
Programmer Analyst
iSOFT R&D Pvt Ltd
Chennai, INDIA
Ph: 91-44-4414980 Extn 1103
|
|
|
|
|
When I get the properties of my new databse in Enterprise manager in the collation names it is said:
SQL_Latin_General_CP1_CI_AS
The question is what is CP1?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
CP1 obviously means: Codeproject is the number 1 - simply the best.
But I think, more realistic would be Code Page 1.
|
|
|
|
|
Martin Ziacek wrote:
Code Page 1.
What does it mean?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
You do not believe, that's code project, do you?
Have look here: MSDN
|
|
|
|
|
In SQLServer 2000 I have a table with 25000 rows 7 columns. One of the columns is a nvarchar of 60. I need to do a substring search on that column and the performance is very poor, 3-10 seconds. The search is done by a stored procedure, for example a search for "John Doe" is implemented in SQL by a simple "LIKE %John% AND LIKE %Doe%". I need the functionality of this kind of query, but it's just too inefficient and slow.
Any suggestions or references on improving text searching using SQL would be most appreciated.
David
|
|
|
|
|
You might want to try setting up Full Text Search.
Other than that, if you're searching for "John Doe", wouldn't you want the like to look like this: LIKE '%John Doe%'
Andy Gaskell, MCSD MCDBA
|
|
|
|
|
I'd looked at Full Text Search before, but maybe I missed something... Thanks.
The LIKE statement is weird because Searching for "John Doe" is suppose to return matches like "John Jackson" and "Jane Doe". That's the only way I've found to get result.
|
|
|
|
|
Is there an index on the column? Also, what about just using LIKE %JOHN DOE% instead of LIKE %John% AND LIKE %Doe%?
|
|
|
|
|
Is there an easy way to make VS or some SQLServer tool create a script for
me that will install my application's database schema in a new, empty
database (for a new installation of the app)? Or is there a better way?
Backup/restore?
Thanks!
Steve
|
|
|
|
|
hi,
SQL Server has an inbuilt schema generation tool to create scripts
Just right click any database and choose 'Generate Scripts'. Check the options required for your deployment.
Ravi Shankar S
Programmer Analyst
iSOFT R&D Pvt Ltd
Chennai, INDIA
Ph: 91-44-4414980 Extn 1103
|
|
|
|
|
Ravi,
Thank you. I hadn't noticed it before.
However, in my Visual Studio Server Explorer, the "Generate Create Scripts" item appears in the context menu but it is disabled (grayed out). It looks like maybe I need to install the "Client Tools"? But I don't know how to find them since my SQL Server came with Visual Studio.
Any help?
Thanks again,
Steve
|
|
|
|
|
Hi
scrozier wrote:
It looks like maybe I need to install the "Client Tools"?
Visual Studio .NET Server Explorer uses the SQL Server Generate script dialog (When you click the menu, the same dialog appears as in SQL Server Enterprise Manager). So, You must have SQL Server Enterprise Manager installed in the machine that has the Visual Studio installed.
Ravi Shankar S
Programmer Analyst
iSOFT R&D Pvt Ltd
Chennai, INDIA
Ph: 91-44-4414980 Extn 1103
|
|
|
|
|
I'm using VS.NET and need to distribute MSDE (Microsoft SQL Server 2000
Desktop Engine) with an application I'm building for a client. I've read a
stack of articles and white papers about MSDE that talk all around the
issue, but nothing that deals directly with what must be a relatively simple
task. I am admittedly new to the Microsoft deployment/setup world.
Can someone point me to a source for a step-by-step for MSDE distribution?
Thanks,
Steve
|
|
|
|
|
Yes, MSDE is located on the SQL Server Developer edition or on an Office CD. All you need to do is run the Setup.exe. However, I recommend creating a Batch file to run the Setup because by default when it installs on WindowsNT it will be setup with "Windows Authentication Only" which will mess up any SQL Server Logins you have created. I have yet to find an easy way to run the Scripts after it's installed though.
|
|
|
|
|
Anonymous is correct; but he missed one location to find the setup files.
Microsoft Visual Studio .NET\Setup\MSDE .
After it is installed you should be able to run the osql command to execute scripts.
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
I think the subject line just about says it all...
- DanielD
|
|
|
|