Dynamic SQL for updating any table !
How to create a dynamic SQL statement, that will update any table given as one of parameter. Here I believe, i couldn't use "Set Column1 = Value ....." as the columns will differ according to the table. ...
How to create a dynamic SQL statement, that will update any table given as one of parameter. Here I believe, i couldn't use "Set Column1 = Value ....." as the columns will differ according to the table. ...
How to create a dynamic SQL statement, that will update any table given as one of parameter. Here I believe, i couldn't use "Set Column1 = Value ....." as the columns will differ according to the table. ...
Hi, I have a vb.net function that creates several Stored Procedures based on parameters being passed into the function. I want to move this vb.Net into a single SQL file (for maintenance reasons) but I am not sure how I can re-create it in SQL without creating 7 separate stored procedures. I create a total of 20 Stored Procedures and ...
Some of the queries I have written inside MS-Access are getting deleted automatically. And while I run the queries through code, I get this error 'Query should have one destination field' What can be the possible reason Explanation: I created a query in MS-access. Ran it from the code. Closed the database. Started it again, and now fo...
I installed Oracle 10g express. Installation went well, But the home page is not coming up. I can connect using sqlplus but not with Sql Developer. I checked tnsnames.ora and listener.ora everything looks fine. Listener is also started. I can always reinstall and see. But I thought better inquire the cause. Regarding the home page. Thi...
to reference this again http://stackoverflow.com/questions/501347/sql-products-productsales how could i do something like that when the primary key is made up of two columns and not one? so products has two columns as PK, and productsales has two columns as FK. here is the solution with a 1-column key: SELECT p.[name] FROM products p...
I have a situation where I need to do an update on a very large set of rows that I can only identify by their ID (since the target records are selected by the user and have nothing in common other than it's the set of records the user wanted to modify). The same property is being updated on all these records so I would I like to make a ...
Having this table Table "Items" itemID itemTitle itemContent and this Table "MyList" userID itemID deleted how can I select all rows from table "Items" and showing the field "deleted", even if the itemID do not exist in "MyList", given an userID? Example of the query result: itemID | itemTitle | deleted | userID ---------------...
I'm encountering a very strange problem concerning what appears to be a corrupt index of some kind. Not corrupt in the sense that dbcc checkdb will pick it up, but corrupt in the sense that it has rows that it shouldn't have. I have two tables, TableA and TableB. For the purposes of my application, some rows are considered functionally ...
Does anybody know of a free utility that I can use to view the contents of fields containing binary data in an MS SQL Server 2005 database? ...
As a CRUD developer one of the trade offs that needs to be made is the decision of how much of the work should be done in SQL on the server, and how much ought to be done on the client end in code. How do you decide where the fulcrum goes? What factors go into your decisions? What kind of mistakes have you made? What works well? [ED...
So I have a table as follows: ID_STUDENT ID_CLASS GRADE 1 1 90 1 2 80 2 1 99 3 1 80 4 1 70 5 2 78 6 2 90 6 3 50 7 3 90 I need to then group, sort and order them to give: ID_STUDENT ID_CLASS GRADE RANK 2 1 99 1 1 1 90 2 3 1 80 3 4 1 70 4 6 2 90 1 1 2 80 2 5 2 78 3 7 3 90 1 6 3 50 2 Now I know that you can use a temp variable to rank...
I have a drop down list that reads from the SQL database. depending on the option selected, I want to pull the actual 'value from the DataValueField. how do I do that? Page_Load(object sender, EventArgs e) { ... ddlOption.DataTextField = "Option"; ddlOptions.DataValueField = "OptCode"; ... } protected void ddlOptionSelectionChange(ob...
I have a large database of zip / postal codes used in proximity searches. There are about 1 million records. Somehow I didn't add the primary key to the table, and now I have to add it because searches take about 3 seconds because of the full table scan. When I go to generate a script to add it in SSMS, the operation times out because it...
Hello, I have a table constructed like this : oid | identifier | value 1 | 10 | 101 2 | 10 | 102 3 | 20 | 201 4 | 20 | 202 5 | 20 | 203 I'd like to query this table to get a result like this : identifier | values[] 10 | {101, 102} 20 | {201, 202, 203} I can't figure...
I´m using the LinqDataSource to populate a grid. But now I need the SQL query that the LinqDataSource generates, to pass around throught methods (no, I can't modify the methods to not need a SQL query). Is there a way to obtain the generated SQL query from a instantiated and configured LinqDataSource? ...
I have a Table that looks like this: IP Hostname TransactionDate ------------- ---------- ------------------- 1.1.1.1 A 2009-01-01 01:00:00 1.1.1.1 A 2009-01-02 01:00:00 1.1.1.1 A 2009-01-03 01:45:00 1.1.1.1 B 2009-01-04 01:00:00 1.1.1.1 A 2009-01-05...
I have a table with a FooId and a CreatedTime column. During the day, multiple rows can be inserted for the same FooId. The CreatedTime column represent the time at the moment of the inserting. I would like a query which will return me the latest row for a given day (e.g. 2000-01-01). Is there a way to write a query which will do that ...
I have a temp table that has numeric integer values in one column. I want to either replace the integer values with character values based on some criteria or I want to add another column of character type that automatically inserts values into itself based on some criteria. If x <= 1, change to "SP" or make new column and store "SP" i...
What are your thoughts on this? I'm working on integrating some new data that's in a tab-delimited text format, and all of the decimal columns are kept as single integers; in order to determine the decimal amount you need to multiply the number by .01. It does this for things like percentages, weight and pricing information. For examp...