|
You can confugure SQL Server to use Mixed Mode[^] which include Windows and SQL Server authentication.
Diving Albi wrote: I want to connect to a SQL Server database with a special user that is not the user currently logged on to windows
Then use username and password which are stored in your database.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Unfortunately I do not have the chance to setup mixed mode. I think I will go for Mikas solution.
Thank you anyway.
|
|
|
|
|
|
Thanks! The links are very helpful. This is the way I am going!!
|
|
|
|
|
|
how to use lock concept in sql server 2005?
pls send some examples urgent......
|
|
|
|
|
Google "sql server 2005 locking"
Regards
David R
|
|
|
|
|
I want to Delete Duplicate records From a table except the Max(ID)Using Full Text Query.
and
Duplicate records are just certain field
not an entire row in a table.
and
I have millions of records in my table.........
|
|
|
|
|
Muhammad Fahim Baloch wrote: I want to Delete Duplicate records From a table except the Max(ID)
You should be more specific how you define duplicate. Obviously you wnat to save the latest, but what's duplicate for you in this case.
Muhammad Fahim Baloch wrote: Using Full Text Query
How does this relate to duplicates?
Muhammad Fahim Baloch wrote: Duplicate records are just certain field
Which fields? It would be easiest if you provide a dessciption of the table and tell that based on what columns you want to observe the duplicates.
Muhammad Fahim Baloch wrote: I have millions of records in my table
And how does this relate? Concerned about the speed perhaps?
|
|
|
|
|
I have a table, which has two rows
1.EmailID
2.EmailAddress
I have Duplicate Email Addresses and i want to Delete Duplicate Email Addresses from my table except the max(emailId)
and I have millions of Duplicate EmailAddresses in my table
Plz ans me as soon as possible....
Thanks!
|
|
|
|
|
Muhammad Fahim Baloch wrote: I have Duplicate Email Addresses and i want to Delete Duplicate Email Addresses from my table except the max(emailId)
You could try something like:
delete from YourTable
where exists (select 1
from YourTable alias1
where alias1.emailaddress = YourTable.emailaddress
and alias1.emailid > YourTable.emailid)
Remember to use begin transaction so that you can rollback if the result isn't what you wanted.
Muhammad Fahim Baloch wrote: and I have millions of Duplicate EmailAddresses in my table
This means that unless you have proper indexing this will take a while.
|
|
|
|
|
Hi
Thnks a lot..............................
Thanku agian.............................
You are doing greate job
Thanks agian,,,,,,,
By
|
|
|
|
|
hi
can anybody tell me about the normalization
thanks
Hemant
By:
Hemant Thaker
|
|
|
|
|
A normalized database (which is a good idea generally) typically means that the minimum amount of data is stored (no repetition) in a relational manner. Take a look here for more info...
http://en.wikipedia.org/wiki/Database_normalization[^]
Regards,
Rob Philpott.
|
|
|
|
|
Hi
I need to put 'abs' for students absent in a review
for exemple of the material which the code is 121 .
I have the following query:
SELECT id_student, CASE WHEN (CODE) = 1 THEN 'Abs' ELSE [121] END AS m1,
[122] AS '2', [123] AS '3'
FROM (SELECT id_field, id_student, NOTE, CODE FROM TEST)
p PIVOT (sum(NOTE) FOR id_field IN ([121], [122], [123])) AS pvt
ORDER BY id_student
I have the error here CASE WHEN (CODE) = 1 THEN 'Abs' because [121]is the type float and 'abs' is a text how to solve this?
Thanks!!
|
|
|
|
|
Change your select to make 121 a char
SELECT id_student, CASE WHEN (CODE) = 1 THEN 'Abs' ELSE '121' END AS m1
or
SELECT id_student, CASE WHEN (CODE) = 1 THEN 'Abs' ELSE convert(varchar,121) END AS m1
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Thank you very much Ashfield.
but the problem is in 'abs' text in float champ
|
|
|
|
|
I know, you want the literal value 'abs' or 121, so if you force your value 121 to become a char type, either by convert (or cast) or just by enclosing it in quotes then sql server will treat BOTH values as char types and will be quite happy (as far as I know).
Try it and see, if it still doesn't work post your new code and the error message again.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Thanks Ashfield!merci beaucoup
i have anouther problem with this code ,I posted a new message.
Thanks
|
|
|
|
|
Hi all,
I have to work on Indexes and triggers in sql server 2000 can any body suggest me any article or resourse where i can learn these things.
Thanks in advance
Best regards
Rameez
|
|
|
|
|
|
I insert and update in an excel database but what is the coding to prevent the duplicating entries in the database. Plz tell in c# language. thanx in advance.
|
|
|
|
|
I have a table of employee attendent like that:
EmpID-----Date----------------Time------------------Status (Field Name)
1-------01/01/2009------01/01/2009 8:00 am--------I
1-------01/01/2009------01/01/2009 12:00 am-------O
1-------01/01/2009------01/01/2009 1:00 pm--------I
1-------01/01/2009------01/01/2009 5:00 pm--------O
2-------01/01/2009------01/01/2009 7:50 am--------I
2-------01/01/2009------01/01/2009 12:00 am-------O
But i want to make a query that take data from table above to be like that:
EmpID-----Date------------In------------Out----------In-------------Out (Fiel Name)
1-------01/01/2009------8:00 am-----12:00 am----1:00 pm------5:00 pm
2-------01/01/2009------7:50 am-----12:00 am----Null----------Null
Can we do that ?
Thank for your kindly to help me...
Best regard,
Sovann
VB.Net
modified on Sunday, February 15, 2009 9:18 PM
|
|
|
|
|
Something like this should get you close
<br />
select c.empid, c.dt as in1, <br />
<br />
(select c1.dt from clock as c1 where c1.empid = c.empid and status = 'O'<br />
and not exists (select 1 from clock as c2 where c2.empid = c1.empid and c2.status = 'O' and c2.dt < c1.dt)) as out1,<br />
<br />
(select c1.dt from clock as c1 where c1.empid = c.empid and status = 'I'<br />
and c1.dt > c.dt) as in2,<br />
<br />
<br />
<br />
(select c1.dt from clock as c1 where c1.empid = c.empid and status = 'O'<br />
and c1.dt > (select c1.dt from clock as c1 where c1.empid = c.empid and status = 'I'<br />
and c1.dt > c.dt)) as out2<br />
<br />
from clock as c<br />
where c.status = 'I'<br />
and not exists (select 1 from clock as c1 where c1.empid = c.empid and c1.status = 'I' and c1.dt < c.dt)
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Thanks for your kindly to help me.
but what you wrote is in query right ?
It did not process.
but if there are more employee, Does it work ?
My idea if we select and use for loop, what can we do ?
VB.Net
|
|
|
|