Query related to SQL Stored proceduer?
150186
Dont declare @i as int, but as varchar(20) and assign it like this\n\nSET @i = '1'
592810
SQL is sort of a standard language for querying relational databases. Visual Basic is a programming language. You can query database with it, but that is not its main function.
858844
you need to check what kind of values you are receiving as a recordset first if you are finding it difficult to access the values. echo the result set as follows\n\n<?php echo $queryResult['columnName']; ?>\n\nyou can loop through the values by using a do-while loop by following\n\n<?php\ndo {\necho $queryResult['columnName']; \n} while (mysql_fetch_assoc($queryResult));\n?>
692285
Your question seems to have gotten cut off.  However, are you referring to referential integrity such as primary and foreign keys?
633256
I think your problem is more basic than this.\n\nYou define a variable named dt and are stuffing a date into it.  This is all well and good.\n\nBut in the next line, you're doing an SQL select.  In this line, dt is the name of a field in table [current$].  The two lines aren't related even though they have the same name.  \n\nIf you want the query to pull back data where the value in field dt is equal to the date 10/5/03, then you have to add a where clause to the SQL query:\n\n"Select dt as CloseDate from [current$] where dt=" & strDate\n\nNot sure which database you are using to select from, so the syntax may be slightly off, but you get the picture.  The thing here is that the SQL query is all text...even the date part.  The only exception to this is if you are running a stored procedure and some of the inputs are declared to be datetime data types.
542676
SQL is used to look at and update data. The primary commands are SELECT, UPDATE, INSERT, DELETE. As programming topics go, basic SQL is as easy to master as anything.
901854
A simple SELECT statement is the most basic way to query multiple tables. You can call more than one table in the FROM clause to combine results from multiple tables. Here’s an example of how this works:\nSELECT table1.column1, table2.column2 FROM table1, table2 WHERE table1.column1 = table2.column1; \n\nIn this example, I used dot notation (table1.column1) to specify which table the column came from. If the column in question only appears in one of the referenced tables, you don’t need to include the fully qualified name, but it may be useful to do so for readability. \n\nTables are separated in the FROM clause by commas. You can include as many tables as needed, although some databases have a limit to what they can efficiently handle before introducing a formal JOIN statement, which is described below. \n\nThis syntax is, in effect, a simple INNER JOIN. Some databases treat it exactly the same as an explicit JOIN. The WHERE clause tells the database which fields to correlate, and it returns results as if the tables listed were combined into a single table based on the provided conditions. It’s worth noting that your conditions for comparison don’t have to be the same columns you return as your result set. In the example above, table1.column1 and table2.column1 are used to combine the tables, but table2.column2 is returned. \n\nYou can extend this functionality to more than two tables using AND keywords in the WHERE clause. You can also use such a combination of tables to restrict your results without actually returning columns from every table. In the example below, table3 is matched up with table1, but I haven’t returned anything from table3 for display. I’ve merely checked to make sure the relevant column from table1 exists in table3. Note that table3 needs to be referenced in the FROM clause for this example.\nSELECT table1.column1, table2.column2 FROM table1, table2, table3 WHERE table1.column1 = table2.column1 AND table1.column1 = table3.column1;\n\nBe warned, however, that this method of querying multiple tables is effectively an implied JOIN. Your database may handle things differently, depending on the optimisation engine it uses. Also, neglecting to define the nature of the correlation with a WHERE clause can give you undesirable results, such as returning the rogue field in a column associated with every possible result from the rest of the query, as in a CROSS JOIN. \nIf you’re comfortable with how your database handles this type of statement, and you’re combining two or just a few tables, a simple SELECT statement will meet your needs.
375504
did you mean filtering data when retrieving from database ? If Sql is used to retrieve data, usually a "where" clause is added to the Select Sql statement to state the conditions, so only filtered records are retrieved from database.
608144
Rob Conery discusses some OLAP drillthrough procedures in his SQL server blog...\nhttp://www.wekeroad.com/blogs/CategoryView,category,OLAP.aspx
521569
Construct your SQL statement from inside the SP and use EXEC command to run it. Suppose you have parameters @ColumnName, @TableName and @number, the SP is like this:\n\n-- declare the sql variable to hold the sql statement\nDECLARE @Sql Varchar(50)\n\n-- construct the sql command using your parameters\nSET @Sql = 'SELECT ' +@ColumnName +'+' +CAST(@Number As Varchar) +' FROM ' +@TableName\n\n-- execute the sql\nEXEC (@Sql)
1007417
Hi..\nCheck out the following page...this might provide your some insight on Query Optimizations...\nhttp://www.sqlsummit.com/Optimization.htm
1062183
We're going to call your row "numbers" and your table "table" for this example.  The SQL code would look like this:\n\nSELECT SUM(numbers)\n   FROM table;\n\nThere you go.
743722
Hello,\nThe inner query, which is\n\nSELECT [Employee Information].FirstName, [Employee Information].LastName, Courses.CourseTitle, CoursesCompleted.CourseID\nFROM Courses INNER JOIN ([Employee Information] INNER JOIN CoursesCompleted ON [Employee Information].StudentID=Courses... ON Courses.CourseID=CoursesComple...\nWHERE (((CoursesCompleted.CourseID)=... THE COURSE NUMBER])))\n\nreturns a set of first names, last names, course titles and course id numbers; however you are checking whether >only< the first name and the last name of a particular employee is in that set. If I'm not mistaken, both sides of the 'NOT IN' clause should contain the same information. In this example, one side (outer query) contains the name of the employee, and the other side (inner query) contains the name of the employee + course information. \nTry this: in the second query select only the first and last name of the employee (not the course info) but keep the joins in the FROM clause.\n\nIf I had designed the tables, I would assign a unique id to each employee, just as courses have their unique course ids. It would have eased this task a lot.\n\nI know I sound confusing, but hope it helps
61405
Convert the parameters in your "where" clause to the same case, upper or lower.\n\nselect * from tbl \nwhere upper(fielda) = upper(searchparameter)\n\nI've not worked with Access (.mdb) dbs much, but there may also be an Access configuration to disregard Case.  (At least that is an option in MS Sql Server.)
930099
I'll give you an idea of the first one so you can learn how to do this yourself.\n\n1. Find the names who directly supervised by Franklin Wong\nselect * from SomeTable where SupervisedBy='Franklin Wong'\n\nThe rest are no different they are all select statements.\nutilising <, >, =, or, and to develope the sql query
664122
SQL Plus has its own system to put query in file.\nyou type 'ed' at SQL Plus prompt and notepad editor edits your querry.\nYou can save as query by selecting save as "All Files" then giving the file extention to .sql\nhope this will solve your problem.
25643
I've included some helpful links listing SQL commands.  Note that some may depend on what specific database you're using (Access, MySQL, PostgreSQL), so you should check the reference for that product.