Wednesday, March 28, 2012
how to associate sql login with a trusted sql server connection?
Last night I loaded a 2nd instance (development instance) of sql server on
my server machine (win2003). The first instance is the local server - serv1
.
The 2nd instance is serv1\dev. I loaded both instances using Windows
authentication. Note: the first instance was loaded on the default port of
1433. But for the 2nd instance, Setup assigned a default port of 0. I went
with port 0 and windows authentication. When I connect to serv1\dev in Quer
y
Analyzer through Windows authentication I connect OK. But I added a sql
login to serv1\dev. I can't connect to serv1\dev from Query Analyzer using
my sql login. The error message says that the login failed because my login
is not associated with a trusted sql server connection. So how do I
associate my sql login with a trusted sql server connection?
Note: On the original install I also added a sql login, and it works fine
from the server computer and from remote workstations. Why did the serv1
login work but not my new login on serv1\dev?
Thanks,
RichAfter doing a little research, I believe my problem is that I loaded
serv1\dev instance of sql server with Windows Authentication where I should
have selected Sql Authentication. When I register serv1\dev I can only
register it using Windows Authentication. Once the server is registered I g
o
into Edit Registration and select Sql authentication but it won't take
because my sql login is not associated with a trusted connection. Is there
a
way around this? Or do I need to re-install this instance?
"Rich" wrote:
> Hello,
> Last night I loaded a 2nd instance (development instance) of sql server on
> my server machine (win2003). The first instance is the local server - ser
v1.
> The 2nd instance is serv1\dev. I loaded both instances using Windows
> authentication. Note: the first instance was loaded on the default port
of
> 1433. But for the 2nd instance, Setup assigned a default port of 0. I we
nt
> with port 0 and windows authentication. When I connect to serv1\dev in Qu
ery
> Analyzer through Windows authentication I connect OK. But I added a sql
> login to serv1\dev. I can't connect to serv1\dev from Query Analyzer usin
g
> my sql login. The error message says that the login failed because my log
in
> is not associated with a trusted sql server connection. So how do I
> associate my sql login with a trusted sql server connection?
> Note: On the original install I also added a sql login, and it works fine
> from the server computer and from remote workstations. Why did the serv1
> login work but not my new login on serv1\dev?
> Thanks,
> Rich|||OK. I figured out the problem. I had to go into the serv1\dev server
properties and click on the "Sql and Windows Authentication" option. Now I
can connect using my sql login
"Rich" wrote:
> Hello,
> Last night I loaded a 2nd instance (development instance) of sql server on
> my server machine (win2003). The first instance is the local server - ser
v1.
> The 2nd instance is serv1\dev. I loaded both instances using Windows
> authentication. Note: the first instance was loaded on the default port
of
> 1433. But for the 2nd instance, Setup assigned a default port of 0. I we
nt
> with port 0 and windows authentication. When I connect to serv1\dev in Qu
ery
> Analyzer through Windows authentication I connect OK. But I added a sql
> login to serv1\dev. I can't connect to serv1\dev from Query Analyzer usin
g
> my sql login. The error message says that the login failed because my log
in
> is not associated with a trusted sql server connection. So how do I
> associate my sql login with a trusted sql server connection?
> Note: On the original install I also added a sql login, and it works fine
> from the server computer and from remote workstations. Why did the serv1
> login work but not my new login on serv1\dev?
> Thanks,
> Rich
How to assign values to a variable from a xls sheet?
I've got this query inside a Sql Task against a Excel connection and I'd like to insert that value into a user variable called "Proyecto". How do I such thing?
select Proyecto from [Carga$]
TIA,
I'm so sorry it's solved!!
I promise you that from now on I'll try not be so impatient..
Monday, March 12, 2012
How to add new columns to the Table
I am new to crystal and i am working on Crystal 9
How do i add columns to the table referenced in the connection of the report..
Let me make it clear.Assume that i have a table with 10 columns and i had created the report by connecting to the DB and run the report...
Now i add another 3 columns to that table and i need to have these 3 columns also in the report..Since we dont have option of editing SQL Query in Crystal 9
Can any one tell me whether is there any option such that when ever there are changes in the table they get reflected automatically to the report i mean when i open the report and click on the table can i see 13 columns instead of 10 and if not then how do i acheive that with out deleting the previous connection bcos there are lots of fileds refred in the report using the first 10 columns..
Thanks in Advance
MoaOpen the Report and Do verify Database. Now it will be updated with latest structure
Friday, March 9, 2012
How to add date and time to Flat File Connection Manager
Nice one:
Expression:
"FileNameBase_" + (DT_WSTR,15)(DT_DBDATE)GETDATE() + "_" + (DT_WSTR, 15)(DT_DBTIME)GETDATE()
Looks like this:
FileNameBase_2006-01-03_08:55:28
Place is on the Connection String property of the Flat File Connection Manager.
HTH,
K
|||
I have the following expression attached to the ConnectionString property of a File Connection Manager:
@.[System::PackageName] + (DT_STR, 4, 1252) DATEPART( "yyyy", @.[System::StartTime] ) + RIGHT("0" + (DT_STR, 2, 1252) DATEPART( "mm", @.[System::StartTime] ), 2) + RIGHT("0" + (DT_STR, 4, 1252) DATEPART( "dd", @.[System::StartTime] ), 2) + RIGHT("0" + (DT_STR, 4, 1252) DATEPART( "hh", @.[System::StartTime] ), 2) + RIGHT("0" + (DT_STR, 4, 1252) DATEPART( "mi", @.[System::StartTime] ), 2) + RIGHT("0" + (DT_STR, 4, 1252) DATEPART( "ss", @.[System::StartTime] ), 2) + ".log"
Which looks horrible, I know, but evaluates to something alot more user-friendly:
PackageName20060103084130.log
You can choose to make this as difficult or simple as you like. For example
@.[System::PackageName] + (DT_STR, 30, 1252) @.[System::StartTime]
evaluates to:
PackageName03/01/2006 08:41:30
Hope that helps!!
-Jamie
|||Thanks a lot! this gives me a real good start to working more with expressions in SSIS|||
one more question. I tried putting it at the end of my string but it doesn't like it because it is malformed:
C:\Documents and Settings\sss\Desktop\output.txt + (DT_WSTR,15)(DT_DBDATE)GETDATE() + "_" + (DT_WSTR, 15)(DT_DBTIME)GETDATE()
|||Gotta escape the '\' character and gotta be in quotes... :)
"C:\\Documents and Settings\\sss\\Desktop\\output.txt" + (DT_WSTR,15)(DT_DBDATE)GETDATE() + "_" + (DT_WSTR, 15)(DT_DBTIME)GETDATE()
Sunday, February 19, 2012
How to access to database with c# using DSN
Hello, im new in c# language.
Can someone show me, step by step(with simples code) how can i connect to a DSN connection that aconfigure in my odbc connection in my machine, to connect to mydatabase ?
I need only a simple class that use a DSN connection to retreive information from the database.
Best regards
You don't want to use a System DSN. A System DSN uses ODBC which is a wrapper for OLE DB, meaning that you're talking about a lot of unnecessary overhead. The .Net System.Data.SqlClient classes talk directly to the SQL Server, without having to use OLE DB OR ODBC. Instead, you need to figure out how to build your Connection correctly.
TryConnectionStrings.com.
|||Im not use SQL server, my database is db2 in AS/400.
Do u know how to connect directly to an as/400 database ?
|||Hi,
From you description, it seems that you want to connect to your DB2 database by using DSN, right?
I suggest that you can try DB2OdbcFileConnectionString class which describes a DB2 ODBC file connection string.
To create a DSN file and associated connection string
Call the constructor for DB2OdbcFileConnectionString, DB2OdbcSysConnectionString, or DB2OdbcUserConnectionString.
Calling the constructor creates a connection string with default settings. These default settings can be set only through the Data Access Tool user interface.
If you use a file path for a file that currently exists, the system loads the connection string information in that file instead.
Fill in the relevant connection string properties with a call to the properties of the object created.
You can also fill in the connection string with GetString, which returns the connection string as a text string. Once you finish modifying the relevant values, you can return the connection string to the object with a call to SetString.
Save the connection string information back into storage with a call to Save.
For more information, see:
http://msdn2.microsoft.com/en-us/library/ms945575.aspx
Thanks.