T-SQL (SS2K8) :: How To Create Login For Client App

Jan 30, 2015

I have a client application written from C#/winforms app that needs access SQL DB on SQL server 2008 R2 developer. So I need to create a Login for this app with a user/password. But when i created it and put it on the client's connection string, the DB could not be accessed by the client windows forms app and the error was "Login failed for User App1".

Then I tried to login to SQL server from SSMS using the credentials of App1 but it also gave same error "Login failed for user App1". I have following the following steps of creation of the login for App1. i could login from "sa" account and other Admin accounts but not from "App1" account

1. created a server level Login
2. created a DB level user
3. created a Role (a DB role), i even tried creating an App Role
4. given permission to execute stored procedures that handle login

But didn't work. Maybe i made some mistakes in those step. So, how to create an account for user "App1" so it can be accessed by the client windows app and also from SSMS? i would prefer to use account creation from SSMS GUI.

How do i install SQL server 2008R2 in local machine with network accessibility features?

View 1 Replies


ADVERTISEMENT

Using Local Variable To Pass Login Name To CREATE LOGIN Script

Mar 19, 2008

Dear all;

I'm trying to use a local variable @NEW_LOGIN_CODE to pass LOGIN NAME to CREATE LOGIN script as follows:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
declare

@NEW_LOGIN_CODE varchar(255),
@NEW_LOGIN_PASSWORD varchar(255);
begin

SET @NEW_LOGIN_CODE = 'any_login';
SET @NEW_LOGIN_PASSWORD = 'AnyPassword';

CREATE LOGIN @NEW_LOGIN_CODE WITH PASSWORD @NEW_LOGIN_PASSWORD;
end
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

the script will not work unliss I provided a hard coded login code and password as follows:

CREATE LOGIN ANY_LOGIN WITH PASSWORD 'AnyPassword'

what should I do to make the CREATE LOGIN script accept local variables as parameters?

Thanks


View 3 Replies View Related

T-SQL (SS2K8) :: Cannot Access Server From Client App?

Jan 26, 2015

I have a C# windows app trying to access database based the connection string stored in teh app.config file

Here is my app.config parameters

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="con1" connectionString="data Source=127.0.0.1sinclair;initial catalog=kingsroad;uid=balrock;pwd=123456;integrated security=True" />

</connectionStrings>
</configuration>

The reason I want to put an ip address on connection string i just want to create connection strings as people do in their work. When the app tried access the connection string it gives the error in the attachment.

Because I haven't used this user/password for a long time I'm pretty sure the user name and password is correct but i have the following questions

1. Assume the user and password is incorrect, is there way to reset this?
2. what other configuration that i need to do in order to make teh C# app access this Database?

View 2 Replies View Related

Create Variable To Store Fetched Name To Use Within BEGIN / END Statements To Create A Login

Mar 3, 2014

I created a cursor that moves through a table to retrieve a user's name.When I open this cursor, I create a variable to store the fetched name to use within the BEGIN/END statements to create a login, user, and role.

I'm getting an 'incorrect syntax' error at the variable. For example ..

CREATE LOGIN @NAME WITH PASSWORD 'password'

I've done a bit of research online and found that you cannot use variables to create logins and the like. One person suggested a stored procedure or dynamic SQL, whereas another pointed out that you shouldn't use a stored procedure and dynamic SQL is best.

View 3 Replies View Related

T-SQL (SS2K8) :: Is Comparison Of Hash Passwords Happens At Client Or DB Level

Jun 18, 2014

I was told that the authentication is a process that concerns about security. So the authentication process should be hidden from the client as possible and the client should receive a flag value (1= password is correct and authenticated, -1= incorrect password) and/or user name of the authenticated user. So it should be a SQL operation that should occur in the back end. So the process in detail should be, client form sends user name and hashed /encrypted password to SQL, SQL authenticates and it sends 1/-1 with the user name to the client as the return value and the output.

But when i do research that was not the case, all the threads i have seen on web, either the app is windows or web, developers do two operations:

1. the salt value of the user is searched by user name then return the salt value along with the PasswordHash to the client form / or to the business layer

2. Then use the entered password and the returned salt value to generate a PasswordHash and then compare this passwordHash with the returned passwordHash. if match password is correct if not password is incorrect.

Is this actually how developers write code to authenticate a user in a login event? If so basically the password comparison happens at the client side(either in the form or in the business layer) then wouldn't this be huge security risk by exposing the actual salt and passwordHash to the client?

View 5 Replies View Related

T-SQL (SS2K8) :: Export Data To Client Remote Desktop?

Feb 26, 2015

I need to write a stored procedure or SSIS to export data to client's desktop. What is the best way to achieve it?

The requirement is to develop a web application the client can click on the button and the file will be saved to the clients' local C drive.

How should I configure the destination path here?

View 3 Replies View Related

Client EM Produce OS Failed Login Errors

Jul 23, 2005

hi all, have anyone else met with the following problem.we've got a SQL2000SP3a on a 2 active-active node clusters of W2K3,this cluster in using AD.I've found that whenever I use Enterprise Manager on my local computerto register the above instance, it will constantly produce "Failedlogin for <Domain><DomainUser>" errors in the Windows Security Log ofthe database server machine. There's no failed login in the SQL errorlog and I can work normally with the Enterprise Manager. The OS failedlogins error are gone once I un-register the instance from myEnterprise Manager.Does anyone know or met with this before?

View 1 Replies View Related

SQL Server Express Client App Login / Password

Dec 18, 2006

Help!!

I used to have an Access database which had tables for users, roles, actions etc.

This was used by a C++ client app (using ADO) which logged in, got the user ID and password (by raising a login dialog ) and then checked these against a user table and then assigned the roles and possible actions.

Now we have SWL Server Express 2005 - NT Authorisation - how do I get/pass the user ID to the C++ Application so it can get the associated roles? Seems silly to have 2 logins.

Better still can I do away with the App's User table or make its password column invisible to all users bar Admin and the C++ App?

View 1 Replies View Related

MSDE Connection Problem (from Other Client, Win/sql Login Enabled)

Dec 1, 2003

I have Installed MSDE SP3a (sql2kdesksp3.exe) on a Windows 2003 Web Edition Server.

The security mode is win/sql. I can log in with both Win NT and SQL security localy, from both EM and MSDE manager.

(in the end of the installation, no dialog show, and the agent does not start automaticly, started on restart)

The MSDE is installed from cmd, with no SAPWD but SecurityMode=SQL.

But from another client on the network (same domain), I can´t connect. I get the "SQL Server Does Not Exist or Access Denied" Error Message

I have check the regestry for the tcpip port settings. And its not 0.

I have read some other MSDE related threads, but no luck.

Any hints what to check new, to try to solve this problem ?

peace.

View 3 Replies View Related

Login Failed For User 'sa'. [CLIENT: &&<local Machine&&>]

Jan 23, 2008

One of my co-worker changed the sa password today. After that we are getting this error. The SA account gets locked every time. Even within few seconds of unlocking the SA account, it gets locked again. Error message is not clear as what session still using old password and causing the SA account to get locked? Any of our application does not use SA user to connect to databases. We have Tivoli installed on the same system and the GUI of tivoli has the correct password.

Shailesh

View 3 Replies View Related

Login Failed For User 'domainuser' Using .NET SQL Native Client

Mar 18, 2008

On computer 1, I am programming a C# utility to connect to a SQL 2005 SP2 Database. Here is the connection string.


Server=serverName;Database=database;User Id=DOMAIN/DomainAccount;Password=password;

I am using Visual Studio 2005 with .NET 2.0.

I have logged into Computer 1 with a different account. When I run the utility, I get a login failed exception. Here is the error I get from SQL 2005.



Login failed for user 'DOMAIN/DomainAccount'. [CLIENT: xxx.xxx.xxx.xxx].
Error: 18456, Severity: 14, State: 6.


xxx are filled with the valid IP address of the computer I am running the utility from.

When I log into the computer 2 with the same domain account, it runs with success.


Login succeeded for user 'DOMAIN/DomainAccount'. Connection: trusted. [CLIENT: xxx.xxx.xxx.xxx]

When I put Trusted_Connection=True; in the connection string, it connects as me and not the domain user I want to connect to.

When I put Integrated Security=SSPI; in the connection string, it does the same thing.

View 1 Replies View Related

DB Engine :: Client Unable To Establish Connection Due To Pre-login Failure

Oct 28, 2015

I unable to setup a linked server on sql server 2012. The destination server is on sql server 7.0. I can able to setup the same linked server on sql 2005 sp4 and sql 2008 r2 but unable to setup on 2012. I am getting the below error message. OLE DB provider "SQLNCLI11" for linked server "" returned message "Client unable to establish connection due to prelogin failure".

View 3 Replies View Related

Login Failed For User 'TESTadministrator'. [CLIENT: &&<local Machine&&>]

Nov 6, 2006

Hi Friends,

I am getting the below error while installing CSF DevLite edition on

Following is the breif Info

Server Is : Win2003

SQL SERVER 2005 Installed on Same PC

Domain Name is : Test

User : Administrator he is a build in Admin,

PLEASE HELP ME!!!! Thanking in advance.

EVENT LOG 1:

Login failed for user 'TESTadministrator'. [CLIENT: <local machine>]

EVENT LOG 2:

The description for Event ID ( 11609 ) in Source ( MsiInstaller ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Product: Microsoft Connected Services Framework 3.0 Developer Edition Lite -- Error 1609.An error occurred while applying security settings. Power Users is not a valid user or group. This could be a problem with the package, or a problem connecting to a domain controller on the network. Check your network connection and click Retry, or Cancel to end the install. Unable to locate the user's SID, system error 1332, (NULL), (NULL), (NULL).

View 7 Replies View Related

Limit Client Ip To Login SQL Server 2005 Express.(compare MySQL)

Jan 10, 2007

Hi,

In MySQL,

"GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.1' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;"

This gives the permission to 'root' user from '192.168.1.1'. Another user or another ip couldn't connect to this server.

In SQL Server 2005 Express, can I implement like above query statement?

View 1 Replies View Related

MSSQLSERVER Login Failed For User 'MACHINEuser'. [CLIENT: &&<local Machine&&>]

Jul 29, 2006

I just did a fresh install of SQL Server 2005 Developer Edition and SP1. I elected Windows auth during install. After rebooting I get 2 errors in my Application Event Log: MSSQLSERVER Login failed for user 'COMPUTERuser'. [CLIENT: <local machine>] (event ID 18456) and Report Server Windows Service (MSSQLSERVER) (event 107) which says: Report Server Windows Service (MSSQLSERVER) cannot connect to the report server database. In the data section it says it can't connect to the machines "master" database. I can manually login. How can I fix the problem and get rid of these messages? Thanks. Mark

View 11 Replies View Related

Maintenance Plan Failing With Login Failed For User 'sa'. [CLIENT: &&<local Machine&&>]

Nov 28, 2007

Maintenance plan for bakcup is failing with "Login failed for user 'sa'. [CLIENT: <local machine>]"

I went to the Maintenance Plan and opened the Subplan. I clicked the "Manage Connections"

It has three tabs:

Name: Local Server Connection
Server: prod
Authentication: SQL Server Authentication

I clicked the Edit and it shows the Connection Properties:

It says: Enter information to logon to the server. "Use a specific Username and Password" is checked. Username is set as "sa" while the password is empty. I typed in the correct password and pressed Ok. When I go back again, the password still shows empty. I tried to run the plan and it again fails. Do you know why it is not showing the password as blank even if I try to save the password.

View 1 Replies View Related

Create A Client Install Directory For SQL 2000

Dec 19, 2001

Is there a way to extract (and copy to a network drive) the necessary files from the SQL Server 2000 CD for the purpose of a creating a client install directory? I would like to invoke the Setup from the network. I do not want to place the whole CD on the network. I do not necessarily want to have to re-key the serial number (product key) every time a client install takes place.

View 1 Replies View Related

MSSQL2000 Client Unable To Create New Table

Dec 18, 2005

HELP!
I'm new to SQL Server and I'm sure this is a simple problem.
But I can't seem to solve it.
Here's the problem:
My website & MS SQL 2000 Server are being hosted by Networksolutions.
Thru the Client Enterprise Manager I am Unable to create a New Table.
This is the error message I get:
" [MS Design Tools]-ODBC error: [Microsoft] [ODBC SQL SERVER DRIVER] [SQL SERVER] SELECT permission denied on object 'sysobjects', database 'namedb', owner'db' " :confused:

View 2 Replies View Related

Error: Login Failed For User ... Microsoft Sql Native Client . In Remote Connection On Integration Service

Apr 10, 2007

Hi



i connect to remote Integration Service. i configure server for remote connection( on component services and DCOM config , ... ) .and now i can connect to Integration Service remotely and correctly.



but when i expand Stored Package and then click to expand MSDB this error will hapen:

login failed for user ... .(microsoft sql native client )



please help me



thanks in advance

View 1 Replies View Related

Cannot Connect To Sql Server 2005 From Xp Client When Trying To Create ODBC Dsn

Mar 2, 2007

Newbie here,

I am trying to link tables from an access 2003 frontend to sql server 2005 backend.

I am doing this in a vmware test environment. I am using vmware server and running sbs 2003 and xp sp2 client. Both virtaul machine can talk to each other(using local host connection).

I have tried to create a dsn to the sql server but i cannot connect. I can ping the sbs server through the command interface but the error i get when i try to connect is :

Connection failed:
Sql state: hyt00
sqlserver error: 0
microsoft odbc sql server driver timeout expired.

spent a day trying various combinations - still no joy.

Any help would be much appreciated

View 3 Replies View Related

Clueless Client Who Wants To Create A Table Using Reserved Words

Mar 19, 2004

Hello all,
I have a database that supports two different applications.
For arguments sake I'll call them "intelligent app" and "clueless app"

The client that provided me the schema for the clueless app used reserved words as field names.
The words used are:
value, state, and time

I explained to the client that modifying them could prevent current/future issues.

The client is an "oracle" db (and in my mind should know better but .....) and responded back to me with the following:

BEGIN QUOTE
They are not currently reserved and there is no guarantee they will ever be reserved. In fact, the SQL server line eliminates as many words from the reserved list as they add with new releases. There are other words on the
possible future reserved keyword list that I do not wish to avoid either unless forced to some day, like depth, size, class, zone, level and others.
END QUOTE

Now for the assistance request, where can I find the documented ramifications of using reserved words?
I want to have my documentation (and my ducks lined up) when this clients portion of the app fails.

Any and all assistance is greatly appreciated.

T. Mullins

View 4 Replies View Related

Can't Create Excel File With SQL Server 2000 Client.

Jan 3, 2007

Hi ;

I am trying to create several Excel sheets using SQL 2000 views like so:

Select * INTO [Excel 8.0;Database="C:spreadSheetsaNew.xls"] FROM [aView].

When I try and execute this in my app I get the following - Specified owner
name 'Excel 8.0;Database=c:spreadSheetsaNew.xls' either does not exist or
you do not have permission to use it.

If I use the above Select statement with an OLEDB connection it works.

I am using Imports System.Data.SqlClient, instantiating a new SQlConnection
object, opening the connection, etc..

Thanks,

Gordon

View 1 Replies View Related

Client Connection Error While Trying To Create Maintenane Plans

Mar 1, 2007

Error:  Ole db error 0x80004005 Client unable to establish connection

This happens when trying to create a maintenance plan in sql 2005 sp 1

It has now happend with 3 installs - one fresh install and two upgrades from 2000 to 2005.  The startup account for sql server is a domain user account and has not been changed.  This happens on both windows 2000 and windows 2003. 

 

This however does not happen if the sql startup account is in the local admin group for the machine

 

Any help is greatly appreciated

Thanks

KR

View 2 Replies View Related

SQL Server 2012 :: Using CTAS Create Stored Procedure For Client

May 14, 2014

I have table named TEMPLATE_ACTIVITY. This is template table I have 27 this kind of tables.

I want to create stored procedure to change name MICHELIN_US_ instead of TEMPLATE_ all remaining name should be same. For that I am using 'Create Table As Select' to keep same structure as Template tables.

I want to create sp as like execute this way Exec @MICHELIN_US_

So that in future if Client change to MICHELIN_US_ to UNITED_ I can just change Exec @UNITED_

And it will change all table names to UNITED_ACTIVITY

I want to create this SP for different client.

View 3 Replies View Related

SQL Server 2012 :: How To Drop And Create Synonym Without Client Error

Apr 23, 2015

A heavily-selected database will be in an inconsistent state for several hours during a batch process. For that time, a database snapshot is created and accessed instead. To allow constant client read access to the database, a database that only contains synonyms exists. Those synonyms point to the main database except during the batch process, at which time they point to the database snapshot.

To switch the synonyms, each synonym is dropped and then created pointing to the database snapshot (after its creation, of course). The drop/create occurs inside a transaction. Roughly, the SQL looks like this:

SET XACT_ABORT ON;
BEGIN TRANSACTION;
DROP SYNONYM [dbo].[some_proc];
CREATE SYNONYM [dbo].[some_proc] FOR [snapshot_db].[dbo].[some_proc];
GRANT EXECUTE, SELECT ON [dbo].[some_proc] TO public;
COMMIT TRANSACTION;

When the batch update is completed, the process is reversed with "snapshot_db" replaced with "regular_db". The SQL snippet above is dynamic SQL. What I've pasted is the dynamic SQL that is executed as a single batch.

While this switch is happening, clients are accessing the procedures through the synonyms, potentially at a high request rate. Testing reveals that clients can get the error:

Error=-2147217900, Id=0, Meaning=IDispatch error #3092,
Source=Microsoft OLE DB Provider for ODBC Drivers,
Description=[Microsoft][ODBC SQL Server Driver][SQL Server]Could not find stored procedure 'dbo.some_proc'.

This error only occurs once. If the same SPID retries its request and the transaction has not completed (for testing, a delay was added), then it blocks until the transaction completes.

Any way to prevent it besides a client-side retry?

View 2 Replies View Related

T-SQL (SS2K8) :: Create Index With Few Options

Mar 22, 2014

I would like to create an index with a few options but having issues trying to parse and run it successfully. The issue is near the end of the statement. Here's the create statement below:

-- Index PSAPSACTIVITYDEFN on table PSACTIVITYDEFN
IF EXISTS(SELECT 1
FROM sysindexes si
INNER JOIN sysobjects so
ON so.id = si.id

[code]....

View 4 Replies View Related

T-SQL (SS2K8) :: Create Table Dynamically?

Sep 5, 2014

I am having SP which gives, two result sets. The columns which are coming from result sets are also dynamic.
i.e. some time 5 columns and some time 10 columns.

Now I want to load this output into 2 different tables on daily basis. This would be truncate/delete table and load again.

Now my problem is that as I am not sure about columns, Is it possible to create table(Physical Table) depends on output of SP, and after load data into it.

During each load we can drop table, No issue and we can handle this through SSIS Package.

View 2 Replies View Related

T-SQL (SS2K8) :: How To Create Stored Procedure

Oct 16, 2014

yesterday i was trying to create Stored procedure but it fails i don't know why

CREATE proc GetBooksbyBorrowerID @Borrower_id INT
AS
BEGIN
SELECT A.BORROWER_ID ,a.ISBN, b.book_Title,b.LANGUAGE, CONVERT(VARCHAR,a.borrowed_from_date,103)"Borrowed On(dd/mm/yyyy)" FROM borrower_details a, book_mst b
WHERE a.borrower_id=@Borrower_id
AND a.ISBN = b.ISBN
END
GO
EXEC SP_Task1 10001

View 9 Replies View Related

T-SQL (SS2K8) :: HOW To Create Filestream For Filegroup For A DB

Dec 5, 2014

i have a DB in SQL Server 2008. and i wants to store file in DB.how can i create filestream for filegroup for a DB in SQL Server 2008

View 1 Replies View Related

T-SQL (SS2K8) :: Create Index For A Specific Query That Is Used A Lot?

Jul 28, 2014

I am trying to create an index for a specific query that is used a lot.

Unfortunately I am keep getting a clustered index scan. (4.6 mil rows)

Googling "AND" and "OR" is tricky, but did lead met to many articles about filtered indexes.

None of which gave me a clear answer.

How can I make an index for this query?

Here's the code setup

------------------------------------------------------------------------------------------
-- Setup
------------------------------------------------------------------------------------------
IF OBJECT_ID('FilterTbl') IS NOT NULL
DROP TABLE FilterTbl
CREATE TABLE FilterTbl
(
SurroIDInt IDENTITY PRIMARY KEY,
CompIDSmallInt,

[code]....

View 3 Replies View Related

T-SQL (SS2K8) :: Create Column Alias With Concatenation?

Sep 16, 2014

I want to create column name dynamically in select list.

create table #temp(name varchar(10), sale int)
insert into #temp values('john',1000)
insert into #temp values('Mike',500)
insert into #temp values('Abhas',200)
select name,sale as sale from #temp

Now i want change column alias only , not value. I need to concatenate sale with year value of getdate(). i.e. column header concatenation only, not a output value.

so my output would be as

name Sales2014
john 1000
Mike 5000
Abhas 2000

View 4 Replies View Related

T-SQL (SS2K8) :: Create A Job That Import Access Database?

Sep 24, 2014

I need to create a job that import an access database.

Does exist a command that I can use to do that?

View 6 Replies View Related

T-SQL (SS2K8) :: Need To Create (or Insert) A Row For Every Calendar Month

Sep 24, 2014

I have a Table with Financial Data in it and for Certain Accounts (the Key Field is actindx Column)there is no data for Certain Months.

I need a query to fill in the data for each Calendar_Month. This should look at the actindx column and Calendar_Month column if there is no data for a specific Month for that actindx I want it to copy all columns for that actindx and insert into a new row, but just puts Zero Dollars for ActivityDebit, ActivityCredit, and NetAmount.

I have created a CalendarMonth_Lookup Table. I assume there is a way to outer Join the two and insert rows or use an "IF" ,"THEN" type of Statement and just manually add the Calendar Month data.

I am including all the code to make the tables and Insert Data into them.

CODE TO CREATE GPBalances Table
CREATE TABLE [dbo].[GPBalances](
[GP_Balance_ID] [int] IDENTITY(1,1) NOT NULL,
[FISCALYEAR] [smallint] NULL,
[ACCTPERIOD] [varchar](255) NULL,
[YEAR_MONTH_TEXT] [varchar](255) NULL,

[Code] ......

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved