|
how i can check if my password is equal password of sa
i meaning i create view and i want check if password = password's sa
Create view V_Ar_Orders
As
if 'password' = Password's Sa
Select *
From Ar_Orders
Else
Print error
Go
i need do that
123
|
|
|
|
|
select * from syslogins where 1 = pwdcompare(@mypwd, password)
Regards
KP
|
|
|
|
|
Hi, I'm trying to simplify a stored procedure but have got stuck. I have a table that contains a list of 'items' and another that contains a list of 'options' associated with each 'item'.
I am currently executing the stored procedure for each item one by one. Obviously this is a bad way, as it hammers the server.
Is there a way to return the 30 options as 30 columns for each item/row?
Hope that makes sense..
Thanks in advance,
Phil Hodges
"Rules are for the obedience of fools and the guidance of wise men"
|
|
|
|
|
Phillip Hodges wrote: Is there a way to return the 30 options as 30 columns for each item/row?
Yes. But you haven't mentioned which database you are using so an example would be a bit of a stab in the dark hoping that you might be using the same database.
If you are using SQL Server 2005 you might want to look up the documentation for PIVOT
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
It's a really bad idea to try to "flatten" your structure this way. There are many ways that you could retrieve the data, but one approach would be to retrieve the data in the items information, and then perform a separate select inside the same procedure to retrieve the options based on the same criteria as you used to retrieve the item.
Then, all you need to do is (assuming you are using .NET), retrieve from the first table into a DataAdapter and retrieve the second table into the same DataAdapter as a new DataTable. In the data adapter, you would then create a relationship between the first DataTable and the second DataTable.
That's it. Search Google for creating master detail in ADO.NET.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Phillip Hodges wrote: Hope that makes sense..
Uh, well maybe, sort of, a little...
If the 30 options are fixed (constants), then maybe you do want a PIVOT table like Colin suggested. Otherwise, I am confused about what you want. Perhaps an example would help. Or, if you already have what you need, well that'll work too.
David
|
|
|
|
|
Hi i have imported tables from local to server and when i do those the tables will have owner as the project name or ..
But i'm unable to use the table in my stored procedure with a different owner its giving an error saying invalid object....
Can some one just help me by letting me know how i can change the owner to dbo...
If i create a table on the server then the owner is dbo only
but if i import only i'm getting this error
Hepsi
|
|
|
|
|
sp_changeobjectowner 'itemname', 'owner'
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
should i write a stored procedure can u explain it clearly PLEASE because i'm new to these...
THANK YOU
|
|
|
|
|
hepsy.i wrote: should i write a stored procedure
Errm no. Just execute it in Query Analyzer or Enterprise Manager.
Suppose you want to change the owner of the table myTable to dbo, you would enter
sp_changeobjectowner 'myTable', 'dbo' and then execute it directly (using F5).
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thank you very much ...
But my problem is i dont have query analyzer in my sys ..
Is there another way of doin this
Please help me..
THANK YOU
|
|
|
|
|
You could always write a program to execute the query. Be aware that you need to have admin privileges to change the information.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thank you,
I got it by using....
by opening table and clicking show/hide sql pane
Tahnk you
|
|
|
|
|
Pete O`Hanlon wrote: or Enterprise Manager
If you meant the new tool in 2005, it's called Management Studio.
The more I use this tool the more I realise that it's schizophrenic - it's actually both Query Analyzer and Enterprise Manager stuffed into one multiple-document-interface application. There are two query editors - one if you use Open Table (Enterprise Manager), another if you select New Query (Query Analyzer). All in all it's a bit of a mess.
|
|
|
|
|
You're right - I did mean Management Studio, and yes - it is a complete and utter mess. I particularly hate the stored procedure templates - the old Enterprise Studio way was fine for me. Nothing got in the way.
Thanks a lot MS.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hello Friends,
Actually i want to ask, how to install the SQL Server Desktop Edition 2000 Client Tools only from the Command Prompt ? i have gone through the internet but all the responds were about SQL Server Desktop Edition 2005, and it does not work for SQL Server Desktop Edition 2000.
I just could find the below command to install the full package:
setup.exe sapwd=abc123 sequritymode=sql disablenetworkprotocols=0
Could you please help me to get this done,
Appreciate your kind consideration,
Best Regards,
Farhad.
|
|
|
|
|
There are no separate client tools for MSDE 2000. The only tool supplied by Microsoft is osql . The SQL Server 2000 ODBC driver and OLE DB provider are part of the Microsoft Data Access Components (MDAC) version 2.6 and later. Windows XP comes with MDAC 2.7 (under Windows File Protection) and Windows Server 2003 with version 2.8. You must run MDAC_TYP.EXE to install these, if using an older version of the OS (Windows 2000 comes with MDAC 2.5 under Windows File Protection).
See How to manage the SQL Server Desktop Engine (MSDE 2000) or SQL Server 2005 Express Edition by using the osql utility[^].
|
|
|
|
|
Hi,
I am using SQL Server 2005, and I have a couple of questions. My contains can look something like the following:
...CONTAINS(fldBriefDescription, ' "metal" ');
...CONTAINS(fldBriefDescription, ' "metal" AND "hooks" ');
I have a textbox for my search text.
If the user types in hook, and I need it to bring back records that contain the word hook and hooks, and not just hook.
If I type in somthing like today's then it bring back no results. I know for a fact there is such text in the brief description table field. Is it possible to bring back the same results if I type in todays instead of today's or just plain today?
If I type in "metal hooks" then I need it to search for metal hooks, and not just metal and hooks.
I need to use a CONTAINSTABLE to rank the results, and I do not understand how this works. Please can some help me construct the CONTAINSTABLE??
Please can someone help.
Regards,
ma se
|
|
|
|
|
I have a table MyTable with columns col1,col2,col3,col4,col5 in which col1,col2,col3 comprises of composite primary key.
I want to find the number of rows that have different col3 values for same col1 and col2 values.
I want a stored procedure which will provide @c1, @c2 as parameters
Need help
|
|
|
|
|
What have you tried so far? While I could do the query for you, it's helpful to see that you have attempted to do this yourself.
As a hint though, consider using the DISTINCT and COUNT() functions with the parameters to get the count of each. Have a go, and then let me know if you need more help (posting the SQL that you've attempted).
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi
i run a query in sql server 2005 , that show me follow error message ! how can solve this problem?
<br />
Msg 468, Level 16, State 9, Line 1<br />
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Arabic_CI_AS" in the equal to operation.<br />
<br />
tanks
|
|
|
|
|
|
yes
you say right
tanks so much
|
|
|
|
|
Cross posting is not a good idea. I believe that Christian has already answered this one for you.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
yes
but in SQL part usually response not fast .
|
|
|
|