How do I script a password change for a SQL server login?
Just what the title says, I need to change the password for an existing sql server login and I want to do it via sql script. ...
Just what the title says, I need to change the password for an existing sql server login and I want to do it via sql script. ...
I'm creating a web site where all pages hang off a database-driven tree-hierarchy. All but one node has a parent node. Nodes may have role-based read permissions. Some nodes may have special rules (such as: don't display within navigation menus). Nodes may represent links to other nodes (like a shortcut in Windows). Nodes typically ...
I have two identical tables and need to copy rows from table to another. What is the best way to do that? (I need to programmatically copy just a few rows, I don't need to use the bulk copy utility). Thanks rp ...
I am trying to do something I've done a million times and it's not working, can anyone tell me why? I have a table for people who sent in resumes, and it has their email address in it... I want to find out if any of these people have NOT signed up on the web site. The aspnet_Membership table has all the people who ARE signed up on the ...
How can I have SQL repeat some set-based operation an arbitrary number of times without looping? How can I have SQL perform an operation against a range of numbers? I'm basically looking for a way to do a set-based for loop. I know I can just create a small table with integers in it, say from 1 to 1000 and then use it for range operation...
I'm using ADO.NET to access SQL Server 2005 and would like to be able to log from inside the T-SQL stored procedures that I'm calling. Is that somehow possible? I'm unable to see output from the 'print'-statement when using ADO.NET and since I want to use logging just for debuging the ideal solution would be to emit messages to DebugVie...
My boss found a bug in a query I created, and I don't understand the reasoning behind the bug, although the query results prove he's correct. Here's the query (simplified version) before the fix: select PTNO,PTNM,CATCD from PARTS left join CATEGORIES on (CATEGORIES.CATCD=PARTS.CATCD); and here it is after the fix: select PTNO,PTNM,P...
I'm using SQL Server 2005, and I would like to know how to access different result sets from within transact-sql. The following stored procedure returns two result sets, how do I access them from, for example, another stored procedure? CREATE PROCEDURE getOrder (@orderId as numeric) AS BEGIN select order_address, order_number fro...
Question is pretty self explanitory. I want to do a simple find and replace, like you would in a text editor on the data in a column of my database (which is MsSQL on MS Windows server 2003) ...
I'm trying to run some queries to get rid of XSS in our database using Web Data Administrator but I keep running into this Potentially Dangerous Request crap. How do I disable validation of the query in Web Data Administrator? ...
What's the simplest SQL statement that will return the duplicate values for a given column and the count of their occurrences in an Oracle database table? For example: I have a JOBS table with the column JOB_NUMBER - how can I find out if I have any duplicate JOB_NUMBERs, and how many times they're duplicated? ...
I have the following query: select column_name, count(column_name) from table group by column_name having count(column_name) > 1; What would be the difference if I replaced all calls to count(column_name) to count(*)? This question was inspired by a previous one. Edit: To clarify the accepted answer (and maybe my question), using...
I have the following code: SELECT <column>, count(*) FROM <table> GROUP BY <column> HAVING COUNT(*) > 1; Is there any difference to the results or performance if I replace the COUNT(*) with COUNT('x')? (This question is related to a previous one) ...
Edit: Let me completely rephrase this, because I'm not sure there's an XML way like I was originally describing. Yet another edit: This needs to be a repeatable process, and it has to be able to be set up in a way that it can be called in C# code. In database A, I have a set of tables, related by PKs and FKs. A parent table, with chi...
I'm using MySQL in particular, but I'm hoping for a cross-vendor solution. I'm using the NOW() function to add a timestamp as a column for each record. INSERT INTO messages (typeId, messageTime, stationId, message) VALUES (?, NOW(), ?, ?) ...
i have the next tables. groups table which contains hierarchically ordered groups and *group_member* which stores to which groups a user belongs to. groups --------- id parent_id name group_member --------- id group_id user_id ID PARENT_ID NAME --------------------------- 1 NULL Cerebra 2 1 CATS 3 2 ...
I realize that CHAR is recommended if all my values are fixed-width. But, so what? Why not just pick VARCHAR for all text fields just to be safe. ...
Conventional wisdom states that stored procedures are always faster. So, since they're always faster, use them ALL THE TIME. I am pretty sure this is grounded in some historical context where this was once the case. Now, I'm not advocating that Stored Procs are not needed, but I want to know in what cases stored procs are necessary in m...
So specifically in a mysql database. Take the following code and tell me what to do. // connect to the mysql database $unsafe_variable = $_POST["user-input"]; mysql_query("INSERT INTO table (column) VALUES ('" . $unsafe_variable . "')"); // disconnect from the mysql database ...
I'm writing a pretty straightforward e-commerce app in asp.net, do i need to use transactions in my stored procedures? Read/Write ratio is about 9:1 ...