how to creating index in sql2000?
112568
refer these urls..\n\nhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/architec/8_ar_da_5b1v.asp\n\njust surf through the bookmark on left hand side..\nhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/createdb/cm_8_des_05_30s5.asp\n\n\nalso refer this one..simple n straight forward\nhttp://www.1keydata.com/sql/sql-create-index.html
777696
Well, that's one of the first questions i asked when i worked with value sets in oracle applications.. The answer is no way.. you cannot make a distinct select out of value set..\nThere is a work arround though, you can create a veiw with the required data, and then add the distinct keyword to it.. When you create the value set, choose this view and add it's columns and conditions if any.. I'll be glad to go further with that if needed\n\n\nThanks
586764
For example, "rsMember" is your table name, you want to add every single records in "MemberCode" fields into a combobox named "cmbCode". Field "MemberCode" is the first fields on the table, so we call it "Fields(0)". The code is something like this :\n\nrsMember.MoveFirst\nDo while rsMember.EOF  = false\n   me.cmbCode.addItem(rsMember.fields(0).Value)\n   rsMember.MoveNext\nLoop\n\nModify it yourself, ok....\n\nTry to look for some help and sample codes in www.a1vbcode.com
53286
Replace "thetable" below with the name of your table...\n\nselect count(0)\nfrom syscolumns\nwhere id = (\nselect id from sysobjects\nwhere name='thetable'\n)\n;
880681
you can also go :\nTools-Analyze-Documenter\n\nPut this into a module and hit f5. Just a little VB to get you started, let me know if you have any questions.\n\nFunction DocumentTBL()\nDim tdef As TableDef\nDim fld As Field\nDim qry As QueryDef\nDim qryName As String\nDim IndexFields As String\nDim qdefPrimaryKeys\nDim strsql As String\nDoCmd.SetWarnings False\nOn Error Resume Next\nDoCmd.RunSQL "drop table tbltables"\nOn Error GoTo 0\nDoCmd.RunSQL "create table tbltables (ID  COUNTER CONSTRAINT PrimaryKey PRIMARY KEY,TableName text," & _\n                "FieldName text,FieldDataType text,PrimaryKey text,InQueries text,Notes text)"\nFor Each tdef In CurrentDb.TableDefs\n\n    If Left(tdef.Name, 4) = "msys" Then GoTo 1\n    If tdef.Indexes.Count > 0 Then\n        IndexFields = Replace(tdef.Indexes(0).Fields, "+", "")\n    Else\n        IndexFields = ""\n    End If\n    qryName = ""\n    For Each qry In CurrentDb.QueryDefs\n        If InStr(qry.Sql, tdef.Name) > 0 Then\n            qryName = qry.Name & ", " & qryName\n        End If\n    Next qry\n    For Each fld In tdef.Fields\n        DoCmd.RunSQL "insert into tbltables (tablename,FieldName,FieldDataType,InQueries,PrimaryKey) " & _\n                        "values (" & Chr(34) & tdef.Name & Chr(34) & "," & Chr(34) & fld.Name & _\n                        Chr(34) & ",'" & EvalControlType(fld.Type) & "'," & Chr(34) & qryName & Chr(34) & ",'" & IndexFields & "')"\n    Next fld\n1 Next tdef\nOn Error Resume Next\nDoCmd.DeleteObject acQuery, "qryPrimaryKeys"\nOn Error GoTo 0\nstrsql = "SELECT tbltables.TableName, tbltables.PrimaryKey FROM tbltables GROUP BY tbltables.TableName, tbltables.PrimaryKey "\nstrsql = strsql & "HAVING (((tbltables.TableName)<>'tbltables'));"\nSet qdefPrimaryKeys = CurrentDb.CreateQueryDef("qryPrimaryKeys", strsql)\nDoCmd.SetWarnings True\nEnd Function\n\nFunction EvalControlType(ctlType As Integer) As String\nSelect Case ctlType\n    Case acCheckBox\n        EvalControlType = "Check Box"\n    Case acComboBox\n        EvalControlType = "Combo Box"\n    Case acCommandButton\n        EvalControlType = "Button"\n    Case acImage\n        EvalControlType = "Image"\n    Case acLabel\n        EvalControlType = "Label"\n    Case acLine\n        EvalControlType = "Line"\n    Case acObjectFrame\n        EvalControlType = "Frame"\n    Case acOptionButton\n        EvalControlType = "Option Button"\n    Case acOptionGroup\n        EvalControlType = "Option Group"\n    Case acRectangle\n        EvalControlType = "Rectangle"\n    Case acSubform\n        EvalControlType = "SubForm"\n    Case acTabCtl\n        EvalControlType = "Tab Control"\n    Case acTextBox\n        EvalControlType = "Text Box"\n    Case acToggleButton\n        EvalControlType = "Toggle Button"\n    Case acListBox\n        EvalControlType = "List Box"\n    Case dbBigInt\n        EvalControlType = "Big Integer"\n    Case dbBinary\n        EvalControlType = "Binary"\n    Case dbBoolean\n        EvalControlType = "Boolean"\n    Case dbByte\n        EvalControlType = "Byte"\n    Case dbCurrency\n        EvalControlType = "Currency"\n    Case dbDate\n        EvalControlType = "Date / Time"\n    Case dbDecimal\n        EvalControlType = "Decimal"\n    Case dbDouble\n        EvalControlType = "Double"\n    Case dbFloat\n        EvalControlType = "Float"\n    Case dbGUID\n        EvalControlType = "Guid"\n    Case dbInteger\n        EvalControlType = "Integer"\n    Case dbLong\n        EvalControlType = "Long"\n
974290
I don't know of any tools to allow you to work the same way you do in Access, but if you want to do your queries in SQL, see your tables, etc, there are some tools available.\n\nYou have Entreprise Manager and Query Analyser for MS SQL Server (at least in version 2000, the one I use), for MySQL you have Control Center and Query Browser. \n\nCheck this link on query browser:\nhttp://www.databasejournal.com/features/mysql/article.php/3459931\n\nand this one on Control Center:\nhttp://www.lesbell.com.au/Home.nsf/438ebfdb9993616d4a2565d0001a90a1/2c5183e8974ccef8ca256e2900250697?OpenDocument
880002
Do u mean SQL?\n\nuse :\n------------------------- Syntax ----------------------------\nUPDATE <table_name> set <column_name> = Formula\n------------------------- Syntax ----------------------------\n\nHere formula can contain the name of column being edited itself or other columns or any other expression as per requirement.\n\nEnjoy and all the best.
760074
field: LISTID \ntype: INT \nlength: 10\nattributes: unsigned\nnull: not null\nextra: auto_increment\ncheck ON the first radio button (the one under the icon with the key picture)\n\nfield: MYDATE (do NOT use just DATE; DATE is a reserved word in MySQL)\ntype: If you are going to use this with PHP or other Unix-based programming language, you may find it easier to use Unix timestamps, in which case you would make this an INT. Otherwise, DATE\nleave all other items default / blank, unless there will be records without dates. If there will be records without dates, mark the null column NULL\n\nfield: MYWEIGHT\ntype: INT\nlength: 3\nattributes: unsigned (unless you expect negative weights)\nall other items, leave default / blank\n\nfield: MEASUREA (do not use field names that contain blanks)\ntype: FLOAT\nlength/values: 4,2 (the number before the comma is the total length of the float; the number after, the precision. This assumes a float from 00.00 to 99.99)\nattributes: UNSIGNED, unless you expect negative values\nleave all other items blank / default\n\nRepeat for 5, 6, 7, 8\n\nfield: MYBLOG (BLOG is close to BLOB, another reserved MySQL word)\ntype: LONGTEXT\nleave all other items blank / default\ncheck ON the checkbox at the end, under the icon with the T (for FULLTEXT Indexing; this will be useful if you ever want to add text searching to this field)
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.
682934
If you have a 1 to many relationship all you need to do is select the corresponding key and then loop to insert the rest of the records into the second table. For example. \n\nuser table\nuserid as int\nuname as varchar(50)\notherdata\nother data\n\nphonenumber table\nuserid as int\nphone as varchar(16)\n\nTo insert three phone numebrs for user John Doe you so a \nselect userid from user where name = "John Doe" ;\n\nNow that you have the userid, assuming they are in an array. \nfor i = 1 to number_of_phonerecs\n   insert into phonenumber values (varuserid,varphone(i));\nnext\n\nExcuse my SQL as it's late and this is an oversimplified example.
331235
You can reset the autonumber field for an existing table by truncating the table. SQL to do so:\n\nTRUNCATE TABLE tablename\n\nThis destroys all data in the table, so be careful!\n\nYou can create a table in SQL and specify the initial seed value:\n\nCREATE TABLE [tablename] (\n[column0] [number] NOT NULL IDENTITY (100, 1) PRIMARY KEY,\n[column1] [text] NOT NULL,\n[column2] [date] NULL\n)\n\nYou can later change the current index of the autonumber column using ADO:\n\nhttp://allenbrowne.com/ser-26.html
404062
(m)\n\ngoto the following link for logic sql commands\n\nhttp://docs.hp.com/cgi-bin/doc3k/B3060190208.12319/75
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.
148815
or you can check this site\nhttp://asp.net/Default.aspx?tabindex=0&tabid=1
763144
There is no LIMIT keyword in SQL Server 2000 (am not sure about SQL Server 2005). You have to provide a custom tailored solution to page your results. The following Stored Procedure in T-SQL (SQL for MS- SQL Server) will provide you with an explanation on  how to proceed.\n\nThe Procedure LOOKS complicated but it is not. You simply provide it with a PageIndex  and a PageSize and it returns the desired results. For example, for a Page Size of 30 you send the SP the parameters 0 and 30 to retrieve the first page (with 30 results per page). For the next page, you send the SP the parameters 1 and 30, and so on... \n\nHere is the code:\n\nCREATE PROCEDURE northwind_OrdersPaged\n( @PageIndex int, @PageSize int) AS\nBEGIN\nDECLARE @PageLowerBound int\nDECLARE @PageUpperBound int \nDECLARE @RowsToReturn int \n\n-- First set the rowcount\nSET @RowsToReturn = @PageSize * (@PageIndex + 1)\nSET ROWCOUNT @RowsToReturn \n\n-- Set the page bounds\nSET @PageLowerBound = @PageSize * @PageIndex\nSET @PageUpperBound = @PageLowerBound + @PageSize + 1\n\n-- Create a temp table to store the select results\nCREATE TABLE #PageIndex \n(  IndexId int IDENTITY (1, 1) NOT NULL,    OrderID int)\n-- Insert into the temp table\nINSERT INTO #PageIndex (OrderID)\nSELECT OrderID FROM Orders \nORDER BY OrderID DESC\n\n-- Return total countSELECT COUNT(OrderID) FROM Orders\n\n-- Return paged results\nSELECT O.* \nFROM Orders O, #PageIndex PageIndex \nWHERE O.OrderID = PageIndex.OrderID AND    \nPageIndex.IndexID > @PageLowerBound AND    PageIndex.IndexID < @PageUpperBound\nORDER BY\n  PageIndex.IndexID\nEND
1122479
Firstly off 'now()' isn't a function call, it's a string therefore you CANNOT use it for a default value.\n\nYou have to insert a value upon insertion to that table withe the now() string.\n\nLook Carefully about the datatypes of different Time Structures\n==============================\n\n--\n-- Lets use the test Database\n--\nmysql> use test;\nDatabase changed\n\n--\n-- Lets create a Table (temp for this example)\n--\nmysql> create table a (\n    -> x date,\n    -> y timestamp,\n    -> z datetime);\nQuery OK, 0 rows affected (0.02 sec)\n\n--\n-- Lets insert only at column x so rest are default\n--\nmysql> insert into a(x) values(now());\nQuery OK, 1 row affected (0.00 sec)\n\n--\n-- Lets insert only at column y so rest are default\n--\nmysql> insert into a(y) values(now());\nQuery OK, 1 row affected (0.00 sec)\n\n--\n-- Lets insert only at column z so rest are default\n--\nmysql> insert into a(z) values(now());\nQuery OK, 1 row affected (0.00 sec)\n\n--\n-- Lets Select everything in that table\n--\nmysql> select * from a;\n+------------+---------------------+---------------------+\n| x          | y                   | z                   |\n+------------+---------------------+---------------------+\n| 2006-06-15 | 2006-06-15 00:42:17 | NULL                |\n| NULL       | 2006-06-15 00:42:23 | NULL                |\n| NULL       | 2006-06-15 00:42:26 | 2006-06-15 00:42:26 |\n+------------+---------------------+---------------------+\n3 rows in set (0.00 sec)\n==============================\n\nNow notice what happened... TIMESTAMP by default updates the current time...,  The others are null. So change your datatype to be TIMESTAMP if you care so much about the default value.
1132417
Skip calling the stored proc and use a cursor to grab the rows directly and insert them into the second table.\n\nExample cursor:\n--------------------------\nDECLARE @col1_value VARCHAR(100)\nDECLARE @col2_value VARCHAR(100)\n\nDECLARE cc CURSOR FOR\nSELECT col1, col2\nFROM table1\n\nOPEN cc\n\nFETCH NEXT FROM cc INTO @col1_value, @col2_value\n\nWHILE @@FETCH_STATUS=0\nBEGIN\n\nINSERT INTO table2 (column1, column2)\nVALUES @col1_value, @col2_value\n\nEND\n\nCLOSE cc\nDEALLOCATE cc\n--------------------------