Showing posts with label active. Show all posts
Showing posts with label active. Show all posts

Sunday, March 11, 2012

Double Sided Query

ListingLink
ID1 ID2 Active Date
9 2 1 2007-10-22 17:47:31.230
9 7 1 2007-10-22 17:47:32.137
9 6 1 2007-10-22 17:47:32.540
9 8 1 2007-10-22 17:47:33.010
3 9 1 2007-10-22 18:31:15.980

I have this table of Data which will Link to topics together, Problem is I need a Query that will produce 5 Rows if the Input is ID 9. Or One Row if the ID was 2.
Not Conditional just example inputs and outputs.

This will only give one side of the Results
SELECT Listing.sTitle,Listing.iListingID
FROM Listing
INNER JOIN ListingLink
ON listingLink.ID2 = listing.ilistingID
WHERE ListingLink.bIsActive = 1 AND ListingLink.ID1 =9 OR ListingLink.ID2 = 9hi nate Try this one::::

SELECT Listing.sTitle,Listing.iListingID
FROM Listing
INNER JOIN Listinglink
ON listing.ilistingID = listinglink.id1 or listing.ilistingid=listinglink.id2
WHERE ListingLink.bIsActive = 1 and ListingLink.ID1 =9 OR ListingLink.ID2 = 9|||Thanks that works a treat,

SELECT Distinct(Listing.sTitle),Listing.iListingID
FROM Listing
INNER JOIN Listinglink
ON listing.ilistingID = listinglink.iLIstingOneID or listing.ilistingid=listinglink.iLIstingtwoID
WHERE ListingLink.bIsActive = 1 and ListingLink.iLIstingOneID =@.ListingID OR ListingLink.iLIstingtwoID = @.LisitngID

I wrote another query which retrieves the Values except a particular ListingID (9) Turns up as Null so when I print it, the set is correct and requires no application Logic, just got to check which query is faster, will put the reply down.

Though I have a Feeling My Query is Slower

SELECT Distinct(Listing.sTitle),Listing.iListingID FROM Listing,ListingLInk Where Listing.iListingID = ListingLink.iLIstingtwoID AND
iLIstingOneID = 9
Union
SELECT Distinct(Listing.sTitle),Listing.iListingID FROM Listing Right JOIN ListingLink ON Listing.iListingID = ListingLink.iLIstingOneID AND
iLIstingTwoID = 9|||SELECT Distinct(Listing.sTitle) ... please don't do that

DISTINCT is not a function

DISTINCT applies to all columns in the SELECT, not just the one with parentheses around it|||On the back of Rudy's post; this article (http://weblogs.sqlteam.com/jeffs/archive/2007/10/12/sql-distinct-group-by.aspx) is well worth a read.|||Always makes a lot more sense when you step back and look at it, thanks won't make that mistake again.|||Double sided?

Swedish Airline stewardesses?

Sunday, February 26, 2012

Domain Users Rights

I have a problem that im using Active Directory in Win2k Server, when domain users logon to workstations they can't open sql server databases, SQL server is local installed on Workstation and operating system is XP.

When i give administrator rights to users the sql server works fine.

Tell me is there is a way to use sql server without giving to the user administrative rights?

thanksYou need to login as the account that the SQL Server is running in on their boxes (set up a SQL Server "account". You then need to go into SQL Server while logged in as this account and add Domain Users as a login in SQL Server and grant permissions. They can then login and do what they need to do.

Friday, February 24, 2012

Domain Rename - effect on SQL

Hi everyone,
I'm planning an Active Directory Domain Rename shortly - however we have a
number of SQL Servers (2000) on the domain running integrated security.
If I rename the domain, will it cause a problem with Intrgrated security or
not? (the domain is technically the same, but a different name - e.g. users
SID's should be the same I think...!)
Cheers,
SteveHi Steve
I believe that you are correct, as the SIDS are not changing you should be
OK, but just in case you may want to run the script on
http://support.microsoft.com/kb/246133/
John
"SteveHoot" wrote:

> Hi everyone,
> I'm planning an Active Directory Domain Rename shortly - however we have a
> number of SQL Servers (2000) on the domain running integrated security.
> If I rename the domain, will it cause a problem with Intrgrated security o
r
> not? (the domain is technically the same, but a different name - e.g. user
s
> SID's should be the same I think...!)
> Cheers,
>
> Steve|||Thanks for that John - we're a development company, so if things do go
wrong then I'm for the chop. Guess the best thing to do is fire up a test
forest, domain and SQL server and give the rename a go there...!
Anyone got experience in this please let me know!
Thanks again for the help John - appreciated.
Steve.
examnotes <jbellnewsposts@.hotmail.com> wrote in
news:7B62A81D-748F-438F-B00C-B715F0D43F9D@.microsoft.com:
[vbcol=seagreen]
> Hi Steve
> I believe that you are correct, as the SIDS are not changing you
> should be OK, but just in case you may want to run the script on
> http://support.microsoft.com/kb/246133/
> John
> "SteveHoot" wrote:
>|||Hi Steve
I have done migrations but not a rename, if you rename the actual
machine then you will need to drop the server as in
http://msdn.microsoft.com/library/d...nstall_5r8f.asp
Plan your migration and make sure that you have contingencies for
failure at each step, backup the databases, script the jobs, users
etc..
Having a test domain is a very good idea.
John
Steve Hewitt wrote:[vbcol=seagreen]
> Thanks for that John - we're a development company, so if things do go
> wrong then I'm for the chop. Guess the best thing to do is fire up a test
> forest, domain and SQL server and give the rename a go there...!
> Anyone got experience in this please let me know!
> Thanks again for the help John - appreciated.
>
> Steve.
>
> examnotes <jbellnewsposts@.hotmail.com> wrote in
> news:7B62A81D-748F-438F-B00C-B715F0D43F9D@.microsoft.com:
>

Domain Rename - effect on SQL

Hi everyone,
I'm planning an Active Directory Domain Rename shortly - however we have a
number of SQL Servers (2000) on the domain running integrated security.
If I rename the domain, will it cause a problem with Intrgrated security or
not? (the domain is technically the same, but a different name - e.g. users
SID's should be the same I think...!)
Cheers,
SteveHi Steve
I believe that you are correct, as the SIDS are not changing you should be
OK, but just in case you may want to run the script on
http://support.microsoft.com/kb/246133/
John
"SteveHoot" wrote:
> Hi everyone,
> I'm planning an Active Directory Domain Rename shortly - however we have a
> number of SQL Servers (2000) on the domain running integrated security.
> If I rename the domain, will it cause a problem with Intrgrated security or
> not? (the domain is technically the same, but a different name - e.g. users
> SID's should be the same I think...!)
> Cheers,
>
> Steve|||Thanks for that John - we're a development company, so if things do go
wrong then I'm for the chop. Guess the best thing to do is fire up a test
forest, domain and SQL server and give the rename a go there...!
Anyone got experience in this please let me know!
Thanks again for the help John - appreciated.
Steve.
=?Utf-8?B?Sm9obiBCZWxs?= <jbellnewsposts@.hotmail.com> wrote in
news:7B62A81D-748F-438F-B00C-B715F0D43F9D@.microsoft.com:
> Hi Steve
> I believe that you are correct, as the SIDS are not changing you
> should be OK, but just in case you may want to run the script on
> http://support.microsoft.com/kb/246133/
> John
> "SteveHoot" wrote:
>> Hi everyone,
>> I'm planning an Active Directory Domain Rename shortly - however we
>> have a number of SQL Servers (2000) on the domain running integrated
>> security.
>> If I rename the domain, will it cause a problem with Intrgrated
>> security or not? (the domain is technically the same, but a different
>> name - e.g. users SID's should be the same I think...!)
>> Cheers,
>>
>> Steve|||Hi Steve
I have done migrations but not a rename, if you rename the actual
machine then you will need to drop the server as in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/instsql/in_afterinstall_5r8f.asp
Plan your migration and make sure that you have contingencies for
failure at each step, backup the databases, script the jobs, users
etc..
Having a test domain is a very good idea.
John
Steve Hewitt wrote:
> Thanks for that John - we're a development company, so if things do go
> wrong then I'm for the chop. Guess the best thing to do is fire up a test
> forest, domain and SQL server and give the rename a go there...!
> Anyone got experience in this please let me know!
> Thanks again for the help John - appreciated.
>
> Steve.
>
> =?Utf-8?B?Sm9obiBCZWxs?= <jbellnewsposts@.hotmail.com> wrote in
> news:7B62A81D-748F-438F-B00C-B715F0D43F9D@.microsoft.com:
> > Hi Steve
> >
> > I believe that you are correct, as the SIDS are not changing you
> > should be OK, but just in case you may want to run the script on
> > http://support.microsoft.com/kb/246133/
> >
> > John
> >
> > "SteveHoot" wrote:
> >
> >> Hi everyone,
> >>
> >> I'm planning an Active Directory Domain Rename shortly - however we
> >> have a number of SQL Servers (2000) on the domain running integrated
> >> security.
> >>
> >> If I rename the domain, will it cause a problem with Intrgrated
> >> security or not? (the domain is technically the same, but a different
> >> name - e.g. users SID's should be the same I think...!)
> >>
> >> Cheers,
> >>
> >>
> >> Steve

Domain Question

Hi,
We are going to configure a 2-node active/passive SQL
server cluster using W2003 Server Enterprise.
A requirement is that both nodes be a member of the same
domain.
We want to make one of these nodes the Primary Domain
Controller. Obviously if you lose that node in the cluster
you will lose the PDC! Can we make the other node a backup
domain controller? So, we can pull the plug on the PDC and
the BDC will now act as domain controller (and SQL server
will failover too)? Will that work
So is it a bad idea in a 2-node cluster to also have the
PDC and BDC be the nodes in the cluster?
Thanks.
We should not configure our cluster nodes as domain controllers; instead, we should use dedicated domain controllers. If we do configure our nodes in any combination of a primary and backup domain controller, it
could have direct implications for any SQL Server environment, as noted in the following Microsoft Knowledge Base articles
298570 BUG: Virtual SQL Server 2000 Installations May Fail if Installed to Windows 2000 Domain Controllers
http://support.microsoft.com/?id=298570
281662 Windows 2000 and Windows Server 2003 Cluster Nodes As Domain Controllers
http://support.microsoft.com/?id=281662
In general, we should NOT install SQL Server 2000 on a domain controller.
Best Regards,
Uttam Parui
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Are you secure? For information about the Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit http://www.microsoft.com/security.
Microsoft highly recommends that users with Internet access update their Microsoft software to better protect against viruses and security vulnerabilities. The easiest way to do this is to visit the following websites:
http://www.microsoft.com/protect
http://www.microsoft.com/security/guidance/default.mspx

Domain or Workgroup?

Hi,
In a 2-node SQL Server 2000 Active/Passive cluster running
under Windows 2003 Enterprise, can both computers be
member if a workgroup (i.e. "WORKGROUP") or do they "have"
to be members of a domain?
Thanks.
They HAVE to be domain members. The cluster service requires a common
security context to transfer resources and manage virtual servers.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
<anonymous@.discussions.microsoft.com> wrote in message
news:396e01c47f0a$cf308300$a501280a@.phx.gbl...
> Hi,
> In a 2-node SQL Server 2000 Active/Passive cluster running
> under Windows 2003 Enterprise, can both computers be
> member if a workgroup (i.e. "WORKGROUP") or do they "have"
> to be members of a domain?
> Thanks.

Sunday, February 19, 2012

Domain Accounts

Is it possible to assign users to Active Directory groups
and have this one group account granted access in the
database with the appropriate permissions. As oppose to
having many individual Windows domain accounts.
Thanks,
Angelina
Hi angelina
You can grant a login to a group as well as individuals see the
documentation for sp_grantlogin in Books online.
If you allow access to the group all member will have that permission and
therefore it is easier to administer.
John
"angelina" <anonymous@.discussions.microsoft.com> wrote in message
news:43f901c42b7f$249f7f10$a101280a@.phx.gbl...
> Is it possible to assign users to Active Directory groups
> and have this one group account granted access in the
> database with the appropriate permissions. As oppose to
> having many individual Windows domain accounts.
> Thanks,
> Angelina

Domain Accounts

Is it possible to assign users to Active Directory groups
and have this one group account granted access in the
database with the appropriate permissions. As oppose to
having many individual Windows domain accounts.
Thanks,
AngelinaHi angelina
You can grant a login to a group as well as individuals see the
documentation for sp_grantlogin in Books online.
If you allow access to the group all member will have that permission and
therefore it is easier to administer.
John
"angelina" <anonymous@.discussions.microsoft.com> wrote in message
news:43f901c42b7f$249f7f10$a101280a@.phx.gbl...
> Is it possible to assign users to Active Directory groups
> and have this one group account granted access in the
> database with the appropriate permissions. As oppose to
> having many individual Windows domain accounts.
> Thanks,
> Angelina

Domain Accounts

Is it possible to assign users to Active Directory groups
and have this one group account granted access in the
database with the appropriate permissions. As oppose to
having many individual Windows domain accounts.
Thanks,
AngelinaHi angelina
You can grant a login to a group as well as individuals see the
documentation for sp_grantlogin in Books online.
If you allow access to the group all member will have that permission and
therefore it is easier to administer.
John
"angelina" <anonymous@.discussions.microsoft.com> wrote in message
news:43f901c42b7f$249f7f10$a101280a@.phx.gbl...
> Is it possible to assign users to Active Directory groups
> and have this one group account granted access in the
> database with the appropriate permissions. As oppose to
> having many individual Windows domain accounts.
> Thanks,
> Angelina

Tuesday, February 14, 2012

Does there apply any specific Active Directory integration for SQL Server 2000?

Does there apply any specific Active Directory integration for SQL Server 2000?"Peter" <Peter.nospam@.news.com> wrote in message
news:OgyQNLwwDHA.2568@.TK2MSFTNGP09.phx.gbl...
> /Peter
>
Yes, SQL 2000 uses integrated authentication. (through AD of course).
SQL can register with Active Directory so that applications easily can find
Sql servers in the enterprise. *and* SQL can link active directory using
'linked server' and a valid OleDb active direoctry connection string. You
can enter SQL statements to query for and select active directory objects!
Cheers,