Confusing About Connection String Meaning

May 29, 2008

I have some basic skill in SQL Server Management Studio Express already .

But , I still can't understand the exact meaning of ConnectionString.

connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Database1.mdf;Integrated Security=True;User Instance=True"


code above is copied from a machine-generated app.config.

Questions are:
1.what do [[ | ]] and [[ ]]mean in AttachDbFilename=|DataDirectory|Database1.mdf ??

2.what does User Instance mean? And if this it false, what will happen in my computer.

3.Some string I saw before contains InitialCatalog= Northwood. What are the differences between initialcatelog and attachdbfilename ?

Very thanks

View 4 Replies


ADVERTISEMENT

Cannot Set Connection Property Of Backup Database Task If Connection String Is Customized In Connection Object

Aug 23, 2006

I added a connection (ADO.NET) object by name testCon in the connection manager - I wanted to programmatically supply the connection string. So I used the "Expressions" property of the connection object and set the connectionstring to one DTS variable. The idea is to supply the connection string value to the variable - so that the connection object uses my connection string.

Then I added a "Backup Database Task" to my package with the name BkpTask. Now whenever I try to set the connection property of BkpTask to the testCon connection object, by typing testCon, it automatically gets cleared. I am not able to set the connection value.

Then after spending several hours I found that this is because I have customized the connection string in testCon. If I don't customize the connection string, I am able to enter the "testCon" value in the connection property of the BkpTask.

Is this an intrinsic issue?

View 2 Replies View Related

The Connection Name 'LocalSqlServer' Was Not Found In The Applications Configuration Or The Connection String Is Empty.

Sep 27, 2007

Hi,
I'm having a BIG problem, this is my 3rd day looking for answer !I'm trying to create a custom membership provider with MS SQL database 2005 but not the default ASPNETDB. I've changed the web.config to be as following:<connectionStrings><add name="sqlConn" connectionString="Data Source=.;Integrated Security=True;Initial Catalog=ASPNETDB;"providerName="System.Data.SqlClient" /></connectionStrings> <system.web><trace enabled="true" /><roleManager enabled="true" /><authentication mode="Forms" />
<membership defaultProvider="MySqlProvider"><providers><remove name="AspNetSqlProvider"/><add name="MySqlProvider" connectionStringName="SqlConn" type="System.Web.Security.SqlMembershipProvider" applicationName="/" /></providers></membership>
But when I try to login to the site using the login control the following error occurs:
Server Error in '/etest' Application.


Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: The connection name 'LocalSqlServer' was not found in the applications configuration or the connection string is empty.Source Error:



Line 149: <roleManager>
Line 150: <providers>
Line 151: <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 152: <add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Line 153: </providers>Source File: C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Configmachine.config    Line: 151


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.213
 It is clear that this is a prblem with my Machine.Config file - since I've "worked!" on this file for a while. But when I've checked the Machine.config file I've found the LocalSqlServer connection it is talking about! .
I'm lost and I dunno what to do, can anyone help?
Here is the mahine.config in case if you need it:<connectionStrings>
<add name="LocalSqlServer" connectionString="data source=.;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" /></connectionStrings>
<system.data><DbProviderFactories>
<add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /><add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /><add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /></DbProviderFactories>
</system.data><system.web>
<processModel autoConfig="true" /><httpHandlers />
<membership><providers>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" /></providers>
</membership><profile>
<providers><add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers></profile>
<roleManager><providers>
<add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /><add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers></roleManager>
</system.web>

View 8 Replies View Related

Data Access :: JDBC Connection Is Not Using Username Passed In Connection String

Sep 16, 2015

I am using sqljdbc41.jar to connect with MSSQL database, it is working fine on my local machine.Where as on the remote server, same class giving me error

Login failed for user '<domain><windows loginID>'
My connection string is URL...

I am using sqljdbc41.jarĀ  and on 64 bit processor , I am using following command which included path for sqljdbc_auth.dll java -Djava.library.path= C: sqljdbc_4.1enuauthx64 TestDao and error is Login failed for user '<domain><windows loginID>' why it is not picking up username passed in connection string. I have 2 machines, one is local and other is remote. on both machine I login using my domain, it is working absolutely fine on local then why the error is coming on remote machine.Both the machines are identical.

View 4 Replies View Related

The Connection Name 'name' Was Not Found In The Applications Configuration Or The Connection String Is Empty

Jan 18, 2008

I have been trying to host my website on Go Daddy for about 3 weeks and I have cleared several problems but this one remains. I can get into the ASPNETDB database for doing logins , etc but I cant access my database called "PINEmgt".
To try to understand where the problem is located,I built a very simple application without login controls and put on it one Detailform accessing a single line table "Signin". I continually get the error message I got with my real app :"The connection name 'PINEMgtConnectionString2' was not found in the applications configuration or the connection string is empty. " There is only one connection string in my app -'PINEMgtConnectionString2'. When I run the app locally on my machine it works. After I move everything to Go Daddy, I get the error message and the following dump"





Line 24: </Fields>
Line 25: </aspetailsView>
Line 26: <aspqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStringsINEMgtConnectionString2 %>"
Line 27: InsertCommand="INSERT INTO Signup(first_name, last_name, email, customer_id) VALUES (,,,)"
Line 28: SelectCommand="SELECT * FROM [Signup]"></aspqlDataSource>

This is indeed the code from my single page app.

The dump is:




[InvalidOperationException: The connection name 'PINEMgtConnectionString2' was not found in the applications configuration or the connection string is empty.]
System.Web.Compilation.ConnectionStringsExpressionBuilder.GetConnectionString(String connectionStringName) +3039085
ASP.default_aspx.__BuildControlSqlDataSource1() in d:hostinguck7scoutDefault.aspx:26
ASP.default_aspx.__BuildControlform1() in d:hostinguck7scoutDefault.aspx:10
ASP.default_aspx.__BuildControlTree(default_aspx __ctrl) in d:hostinguck7scoutDefault.aspx:1
ASP.default_aspx.FrameworkInitialize() in d:hostinguck7scoutDefault.aspx.vb:912306
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +40
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default_aspx.ProcessRequest(HttpContext context) +29
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +303
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


After Googleing, asking Go Daddy for info (which they dont give) , etc for three weeks, I need serious mental help
in the form of a solution of this problem. Your help with the problem or the name of a good mental health professional in eastern N.C. (maybe both) would be appreciated.

View 10 Replies View Related

The Connection Name 'name' Was Not Found In The Applications Configuration Or The Connection String Is Empty

May 30, 2008



I have seen another thread with this same problem, but the problem seemed to be a typo. I am getting an error when I try to access the web site ..


The connection name 'USASH-AS0013' was not found in the applications configuration or the connection string is empty.

However, in my web.config file I do have a connection named USASH-AS0013. Here is my web.config file (with my user/pwd hidden). Any help would be greatly appreciated.



<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
WindowsMicrosoft.NetFrameworkv2.xConfig
-->
<configuration>
<appSettings/>
<connectionStrings>
<add name="USASH-AS0013" connectionString="Provider=SQLOLEDB;Data Source=USASH-AS0013;User ID=****;Password=*****;Initial Catalog=&quot;Smart Factory&quot;"
providerName="System.Data.OleDb" />
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.

Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<compilation debug="true" strict="false" explicit="true"/>
<pages theme="MySkin" >
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
</namespaces>
</pages>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>

View 3 Replies View Related

SQL Server 2008 :: Connection Manager Not Using Connection String Value

Feb 19, 2015

I have a child package where the ConnectionString property of a Connection Manager is set by a Parent Package Variable Configuration. I set up a script task that brings up a message box with the value of the ConnectionString property right before the dataflow task.

MessageBox.Show(Dts.Connections["CPU_*"].ConnectionString.ToString());When I run the parent package, the message box shows that the connection string is changing with every iteration, but in the dataflow it always draws the data from the same source.

The connection manager is an ADO.Net type, RetainSameConnection is set to False, and I've been researching this for days.

(Update 2/23/2015): To make this stranger, when I look at the diagnostic logs, they tell me that when the new connections are being opened they are using the new connection strings.

View 2 Replies View Related

Cannot Set Connection String For Bulk Insert Source Connection

Jan 4, 2006

I came across something strange today. I was wondering I was doing something wrong.

View 7 Replies View Related

Edit Connection Manager Connection String At Runtime With C#

Jul 3, 2007

This is the first time I have used SSIS, so please bear with the ignorance.



I have a super simple package that inserts x000's of rows into a temporary table. The data source is a file that the user will upload. I need to be able to tell the package what file to upload. I'm thinking the simplest thing would be to edit the connectionString property of the SourceConnectionFlatFile at runtime. Is this possible? What form should the file path be in (UNC, other)? And, are there any other considerations I should be aware of?



Thanks!

View 1 Replies View Related

Variable Connection String For OLE DB Connection

May 15, 2007

Good Morning,



I hope that I am just missing a step in the process somewhere. I have established a string variable called DatabaseServer and another called DatabaseName. In the OLE DB connectionstring expression I have the following:




Code Snippet

"Data Source=" + @[User::DatabaseServer] + ";Initial Catalog=" + @[User::DatabaseName] + ";Provider=SQLNCLI.1;Integrated Security=SSPI;Auto Translate=False;"



My understanding is that changing the variable from SERVERA to SERVERB should repoint the connection. (Test to pre-production to production in my current promotion environment.) This should also take effect in any dataflow task using the database connection above right? When I try to repoint the server variable (and only the server variable) I am either a.)throwing errors saying the original connection cannot be found in the data flow task, or b.)the job appears to be processing fine, but the repoint did not take place and data is still flowing to the original server.



Can anyone offer suggestions as to what I am missing?



The properties values in the DB connection:

ConnectionManagerType is OLEDB

DataSourceID is blank

DelayValidation is False (Setting to true changes nothing in my test)

Expression for ConnectionString is (see above)

RetainSameConnection is False

SupportsDTCTTransactions is True (and appears to be unchangeable.)

View 7 Replies View Related

SP's Confusing Me!

Oct 26, 2004

Argh, I'm really stuck with my SP! I'm not really used to them yet.

I have an advertiser who has multiple advertisements. I need to return a list of adverts with thier first advert.

CREATE PROCEDURE selectAdvertiserByCat
(
@category nvarchar(100)
)

AS

select
distinct advert.advertiser_id,
advert.advert_id,
advertiser.fullname
from
advert
join advertiser on advert.advertiser_id = advertiser.advertiser_id
where
category = @category
GO

I can't figure it out!

View 3 Replies View Related

Do You Know The Its Meaning??

Feb 13, 2007

In ado.net (using C#). have a statement  such as "sqlCommand cmd=new sqlCommand(sqlStatement,stringConnection,sqlTransaction)". do you know the meaning of this bold parameter ? is it its tasks ? thank very much

View 1 Replies View Related

What Is The Meaning Of This?

Nov 5, 2004

I was looking at a Miscrosoft example of a SQL "INSERT INTO".
One example they give isINSERT INTO Northwind.dbo.Shippers (CompanyName, Phone)
VALUES (N'Snowflake Shipping',N'(503)555-7233') What does the "N" stand for (or do) in N'Snowflake Shipping'? Is this really needed? I've looked around some and can't find any discussion about it.

View 6 Replies View Related

What Is The Meaning Of & ~

Apr 8, 2008

Hi,

I cant understand what is the meaning of & ~. I have seen the same in following query. Could any one explain me please.


select p.action & ~convert(int, 0x10000000), N'column' = col_name(p.id, p.colid), p.uid, N'username' = user_name(p.uid),
p.protecttype, o.name, N'owner' = user_name(o.uid), p.id, N'grantor' = user_name(p.grantor)
from #output p, dbo.sysobjects o
where o.id = p.id
order by p.uid, p.id, p.protecttype, p.action

Thanks
-- Krishna

View 2 Replies View Related

What Is Meaning Of 23,59,59

May 8, 2008

set @pDate2= dbo.AsString(@pYear,@pMonth,@pDay2,23,59,59)

explain the above query

View 7 Replies View Related

Meaning

Jun 12, 2008

hey, can anybody help me to understad that code:
SELECT companies.Contact_Company AS am_label1,
ISNULL(Incident_CNT,0) AS NumberOfIncidents
FROM (
SELECT DISTINCT Contact_Company FROM HPD_Help_Desk
) companies LEFT OUTER JOIN (
SELECT COUNT(*) AS Incident_CNT, Contact_Company AS am_label1
FROM HPD_Help_Desk
WHERE Status< 5
AND DATEADD ("s", submit_date, '1/1/1970') >= CAST(CONVERT(char(8),GETDATE(),112) AS datetime)
GROUP BY Contact_Company
) IncidentsByCompany
ON companies.Contact_Company = IncidentsByCompany.Contact_Company

Thank you.

View 1 Replies View Related

Meaning Of ~xxx~

May 14, 2008

Code Snippet<Query>UPDATE OPTIONS SET OptionText = '~DrawerPort~' WHERE...





What is meant by "~" here?

Thanks

View 3 Replies View Related

Meaning Of !=

Dec 2, 2007



In the following example the line of code

IF RIGHT(@StringArray,1) != @Delimiter

includes " != ". What does it mean?

Thanks, Bill

Full Example:-- Creates a UDF that returns a string array as a table result set
CREATE FUNCTION dbo.udf_ParseArray
( @StringArray varchar(max),
@Delimiter char(1) )
RETURNS @StringArrayTable TABLE (Val varchar(50))
AS
BEGIN
DECLARE @Delimiter_position int

IF RIGHT(@StringArray,1) != @Delimiter
SET @StringArray = @StringArray + @Delimiter

WHILE CHARINDEX(@Delimiter, @StringArray) <> 0
BEGIN
SELECT @Delimiter_position =
CHARINDEX(@Delimiter, @StringArray)

INSERT @StringArrayTable
VALUES (left(@StringArray, @Delimiter_position - 1))

SELECT @StringArray = STUFF(@StringArray, 1,
@Delimiter_position, '')
END
RETURN
END

GO

View 3 Replies View Related

Meaning Of N

Nov 25, 2007

An example for finding the length of a string is:

SELECT LEN (N'She sells seashells by the sea shore')

This returns 37. Without the N, it still returns the same 37. Why is N used?

Thanks.

Bill

View 3 Replies View Related

Log Backups Confusing Me

Jul 20, 2004

Please help me out on log backups.


What happens when 2 log backups of the same db happen simultaneously?

Hypothetically:
One Backup Log job run by SQL Server agent(xp_SQLmaint) every 60 minutes & one Log backup run by Backup Exec every 59 minutes.

Is this a dumb idea and will it cause restore problems based on LSN's contained in the 2 separate backup sets?

Thanks
G

View 4 Replies View Related

Should My Where Clause Be Confusing Or NOT???

Oct 19, 2005

heh,heh,heh...cute title, eh? I kill me...

Anyway, The following two select statements return exactly the same results, and utilize exactly the same server resources to run (according to the generated explain execution plans).

The where clause(s) in each are designed to exclude rows that are "empty" according to the designer of the db (don't ask...*rolleyes*).

My question is this...which way would y'all code the select. I have always been "trained" to NOT use negative logic (heh,heh,heh), so originally wrote the select (which, in effect, translates to "get me everything but the empty rows") as:SELECTOSID AS OSID,
[Year] AS QtrYear,
1 AS QuarterNo,
QEPS4 AS EPS,
QSales4 AS Sales,
QInc4 AS Income,
CONVERT(varchar(10), QDate4, 101) AS EarningsReportDate
FROM dbo.RSMsi
WHERE ((QEPS4 <> 0.001 AND QEPS4 <> 0.0)
OR QSales4 <> 0.0
OR QInc4 <> 0.0
OR QDate4 <> '01/01/1900')but in retrospect, I think that's an ugly where clause, and think folks will look at it and think "WTF??? what does THAT mean?". So, I re-wrote the select as if it was looking for the empty rows, then slapped a "NOT" in front of the where clause to negate it in order to STILL say "Get me everything, but NOT the empty rows", as follows:SELECTOSID AS OSID,
[Year] AS QtrYear,
1 AS QuarterNo,
QEPS4 AS EPS,
QSales4 AS Sales,
QInc4 AS Income,
CONVERT(varchar(10), QDate4, 101) AS EarningsReportDate
FROM dbo.RSMsi
WHERE NOT ((QEPS4 = 0.001 OR QEPS4 = 0.0)
AND QSales4 = 0.0
AND QInc4 = 0.0
AND QDate4 = '01/01/1900')whatcha think y'all? It's a style issue, I know...just curious for consensus' sake. Thanks!

View 9 Replies View Related

A Confusing Join (for Me)

Jul 10, 2006

I have 5 tables, the first 4 are responsible for getting wines with all their associated info:

Areas - Regions - Wineries - Wines

The last table is an artwork table, and both wineries and wines can have artwork associated with them. How do I integrate a join on the 'Artwork' table for both wineries and wines, taking into account that sometimes (for a single record) there is art for both winery and wine, sometimes for one, sometimes there is none?

I think I understand the 'ON' statement, for instance:

Wineries LEFT JOIN Artwork
ON Wineries.winery_id = Artwork.artwork_winery_id

'and'

Wines LEFT JOIN Artwork
ON Wines.wine_id = artwork_wine_id

But how do I integrate that into the following SELECT statement?

SELECT
area_id, area_name,
region_id, region_area_id, region_name,
winery_id, winery_region_id, winery_name,
wine_id, wine_winery_id, wine_name,
artwork_id, artwork_name, artwork_wine_id, artwork_winery_id

FROM Areas INNER JOIN
Regions ON Areas.area_id = Regions.region_area_id

INNER JOIN Wineries ON
Regions.region_id = Wineries.winery_region_id

INNER JOIN Wines ON
Wineries.winery_id = Wines.wine_winery_id

ORDER BY winery_name ASC;

- ompadme

View 6 Replies View Related

Confusing Join

Jul 26, 2007

I'm stuck trying to pull together what is for me a complex join statement. I have 8 tables following, and would like to figure out how to extract all users and roles (if they have any associated)
when given a company and division. I have given a couple examples the way they should be output.


RoleTbl
----------------
RoleID|RoleName
----------------
1|Admin
2|User
3|Guest


RoleDivisionTbl
---------------
RoleID|DivisionID
-----------------
1|1
2|1
3|1
2|2

DivisionTbl
----------------
DivisionID|DivisionName
----------------
1|Accounting
2|Marketing
3|Sales

CompanyDivisionTbl
----------------
CompanyID|DivisionID
----------------
1|1
1|2
1|3
2|2

CompanyTbl
----------------
CompanyID|CompanyName
----------------
1|Gap
2|MayCo
3|Sears

UserRoleTbl
----------------
UserID|RoleID
----------------
1|1
2|3
3|2
6|2

UserTbl
----------------
UserID|UserName
1|Jim
2|Frank
3|Kelly
4|Al
5|James
6|Tom
7|George

CompanyUserTbl
----------------
CompanyID|UserID
----------------
1|1
1|2
1|3
1|4
1|5
2|6
2|7

Ex1:
If Company=1 and Division=1
Output:
UserID|UserName|RoleID|RoleName
1|Jim|1|Admin
2|Frank|3|Guest
3|Kelly|2|User
4|Al|Null|Null
5|James|Null|Null

Ex2:
If Company=2 and Division=2
Output:
UserID|UserName|RoleID|RoleName
6|Tom|2|User
7|George|Null|Null


Please help!!! Thanks!!!
Boybles

View 7 Replies View Related

Roles Confusing -Need Help

Jul 20, 2007

I have the following scenerio configured in sqlserver -

Windows group Login User Role

domainAuditConfig domainAuditConfig domainAuditConfigUser AuditConfigRole

domainLookupConfig domainLookupConfg domainLookupConfigUser LookupConfigRole



domainuser belongs to both domainAuditConfig and domainLookupConifg windows groups.

When domainuser logs in, he will have both AuditConfigRole and LookupConfigRole roles.



If I reconfigure the above using loginless user, how can the user takes on both roles at the same time?

It seems to me that the user needs to know what role he needs at the time and run the appropriate EXECUTE AS command. Is this true? I can see the benefits of using EXECUTE AS when we are testing our code. But in a production environment, how can the end user know who to EXECUTE AS?

Does it only make sense to use EXECUTE AS from within an application?



Thanks

View 8 Replies View Related

The Meaning Of Set NoCount On And Off?

Jul 12, 2006

Any one help me out ?
Thank you very much .!

View 2 Replies View Related

Meaning Of Identity

Dec 29, 2007

Hello All,

Does anyone knows what is the meaning of IDENTITY in following 2 rows.

[UserId] [bigint] IDENTITY (0, 1) NOT NULL ,
AND
[ProductId] [bigint] IDENTITY (1, 1) NOT NULL ,

Thanks in advance



--kneel

View 1 Replies View Related

What Is The Meaning Of LTRIM(N' ') ?

Sep 7, 2006

Actually, I don't know what is the meaning and difference of "N" in thefunction.Thanks.

View 1 Replies View Related

Looking For The Meaning Of Some Labels

Jun 27, 2006

Dear fellows,

LOP_BEGIN_XACT, LOP_COMMIT_XACT,
LOP_INSERT_ROWS

Labels as the ones are easy recognizable when you explore LDFS by mean DBCC or whatever but on the contrary the following ones are tricky to reach the meaning:

LOP_IDENTITY_TYPE
LOP_DELTA_SYSIND
LOP_SET_BITS

Does anyone have any link related with this? I tried hard to search by Goog or something like that but unsuccessfully at all.

View 3 Replies View Related

Confusing Data Error

Mar 29, 2007

I have a gridview that is very basic and list name, address, ......., and a URL.
If I have this url in the database I have no problem http://www.lubbockisd.org/earlychildhood/
yet when I place this URL http://www.lubbockisd.org/erlychildhood/stubbs.htm
It triggers this error on my localhost server and my production server.
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
I've made changes to datatypes with no success, made sure my length of data type was set long enough with no success.
Which datatype is best for a URL in sql express? 
Any ideas why this happens with such a minor change?
 
Thanks
 
Tony

View 13 Replies View Related

Sth Confusing About Table Structure

Oct 27, 2007

Hi,I have a table for storing my picture albums here it is:CREATE TABLE [UserAlbum] ( [ID] [int] IDENTITY (1, 1)    NOT NULL , [UserID] [int] default(0) , [AlbumName] [nvarchar] (100) NULL , [Audience] [int] default(0) , [Date_added] [smalldatetime] NULL , CONSTRAINT PK_CmmNet_userAlbum_ID PRIMARY KEY CLUSTERED ( ID )) ON [PRIMARY]GO
it has a field called "audience" as the name defines i want to choose who will see my albumsit is integer and as follows:0 value=everyone1=friends only2=private
as i started to write a query for it i came into this problem:  for exampleif i write SELECT * FROM UserAlbum where   audience=1 then only friends can see the infowhat happens to everyone with value of 0?when i set it to 0, friends should also be able to see the info because it is set for everybody
i noticed i should use "in cluase" like thisSELECT * FROM UserAlbum where   audience in ('0','1') > so in this way both everyone and also friends can see the info
or maybe i should add 3 different fields for private,public,friends
it seems to be simple but at the same time harddoes anyone have a  suggestion?

View 1 Replies View Related

I Am Really Confusing Please Help Me About A Single Query

Sep 1, 2005

Hi Guys,This is my Problem.A table contain following desing for handling different level of categories, bu it is dynamic int_categoryid,int_parent_categoryid,int_categorylevel,str_categoryname,bit_activethatall.I want to list data from table as following ordercategorry_parent11               category_child12                        category_child13                        category_child23               category_child22categorry_parent21.............................................................................................like this..ie we can insert parent category and sub category to n level dynamically without adding a new tableplease mail me for another clarification....please help meregardsAbdul

View 2 Replies View Related

Problem 1/2 DataBind, 1/2 T-SQL -- So Confusing

Jun 14, 2006

Hey everyone,I've got a problem and I can't tell if it's in the stored procedure I'm calling, or it's with the Binding it to the datalist.The error is Syntax error converting datetime from character string.The code it crashes on is:Line 100: //Bind data
Line 101: dg_details.DataSource = reader;
Line 102: dg_details.DataBind();
Line 103: dg_details.Visible = true;
and my store procedure I'm calling is: ALTER PROCEDURE coglej.GetEventsForDate
@eventdate datetime,
@eventowner varchar (50)

AS

IF DATEDIFF(ww,GetDate(),@eventdate ) > 2
BEGIN
PRINT 'Getting EB event price.'
SELECT dbo.events.event_date, dbo.locations.city, dbo.locations.state, dbo.locations.name, dbo.locations.address1, dbo.locations.address2, dbo.locations.zip,
dbo.skus.sku_id, dbo.skus.event_type, dbo.skus.price, dbo.skus.slots_available
FROM dbo.events INNER JOIN
dbo.locations ON dbo.events.location_id = dbo.locations.location_id INNER JOIN
dbo.skus ON dbo.events.sku_id = dbo.skus.sku_id
WHERE (dbo.events.event_date = CONVERT(datetime, '@eventdate')) AND (dbo.skus.owner = @eventowner) AND (dbo.skus.price_type = 'Early')

END
ELSE
BEGIN
PRINT 'Getting regular event price.'
SELECT dbo.events.event_date, dbo.locations.city, dbo.locations.state, dbo.locations.name, dbo.locations.address1, dbo.locations.address2, dbo.locations.zip,
dbo.skus.sku_id, dbo.skus.event_type, dbo.skus.price, dbo.skus.slots_available
FROM dbo.events INNER JOIN
dbo.locations ON dbo.events.location_id = dbo.locations.location_id INNER JOIN
dbo.skus ON dbo.events.sku_id = dbo.skus.sku_id
WHERE (dbo.events.event_date = CONVERT(datetime, '@eventdate')) AND (dbo.skus.owner = '@eventowner') AND (dbo.skus.price_type = 'Regular')

ENDWhat's cause the crash are the quotes around @eventdate.  However, without them, it doesn't return all the rows (if any) and if I have them in, I get this error.  The odd thing is that when I copy and paste one of the SELECT statements into the VWD sql window and replace the variables with the same values I'm using at runtime, everything runs fine.Anyone have any ideas?Thanks in advance,--Joel 

View 7 Replies View Related

Confusing Starting Up Database ....

Jul 7, 2003

Hi,
I have a SQL2k STD with SP3 installed.
Currently, only one database db_XYZ is there. The server has been started up since 07/03/2003 16:00 pm. But in the sql server current log: "Starting up database 'db_XYZ'." info is spreading from that time (16:00 pm) to this morning 10:00am at an interval from every 1 minute to 4 minutes.

Why need to 'Starting up' this database so much times?
This reminds me that this 'Starting up' is kind of 'abused' in many other servers. Any idea?

thanks
David

View 9 Replies View Related







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