I have a database that I need to know what tables are in it and also what views. I also need to know what tables are used in the views. Is this possible with the Sysobjects table? Any help would be greatly appreciated. TIA SQL Newby

I have a table with no primary key and a non-clustered composite index of two columns. When I look at the number of distinct values (selectivity ratio), the table has a ratio of 52% unique values. I thought an index should be at least 90% unique in order for it to be used. Yet when I run the query...

I have a view like below generated from my time and attendance software. staffNo EmployeeName title TransactionType Cdate time 556 JOHN WEB DEVELOPER IN ENTRY 24/01/2008 13:47:30 556 JOHN WEB DEVELOPER OUT ENTRY 24/01/2008 16:38:33 556 JOHN WEB DEVELOPER OUT ENTRY 24/01/2008 16:40:03 556 JOHN WEB...

I'm trying to do simple dynamic SQL in a program to select records for a subfile but it doesn't seem to be working. sSql = 'SELECT orderno FROM ordhdr ' 'WHERE custno = :scSrchCust '; following this I have: exec SQL CLOSE @Orders; exec SQL Prepare Stmt from :sSQL; exec SQL Declare @Orders SCROLL...

I have a table containing answers from different forms. the forms are created dynamically so some forms will have 3 answer fields, some will have as much as 20 answerfields. ex : form_id field_id unique_id field_value 1000 631 1 john doe 1000 632 2 washington 1000 633 3 john@ws.com 1000 631 4 anny...

In Oracle, I can use the analytic ROW_NUMBER function to assign sequence numbers to output rows, re-starting the sequence as certain values change (e.g., there's a separate count for each deptno in this example:) SELECT deptno , ename , ROW_NUMBER () OVER ( PARTITION BY deptno ORDER BY ename ) AS...

I am in the process of establishing a "sandbox" database for a mix of users with SQL development skills. I have done this before with Oracle but not with SQL Server. What I would like to do is build a database whereby each user has their own play area. We are running SQL Server 2005 so I thought of...

We have 4-5 applications on the front end of a portal. On the backend we have mapped these applications to SQL server 2000 Databases. Now, we are planning to migrate on the backend databases to Yukon and map it to the application on the front end. My question: Is it possible to use Yukon for one of...

Hello. I have a report with multiple subreports. User enters date range when prompted from query in main report. I want to refer the subreport date criteria to the date range the user enters for the main report, via the query. I used this in the query criteria under the date...

Dear all, Please help me I am not good in sql queries. I have a view like this. SNo Employee title Cdate IN TIME OUT TIME 258 john accountant 27/01/2008 7:28:12 258 john accountant 27/01/2008 7:28:30 258 john accountant 27/01/2008 16:03:42 258 john accountant 27/01/2008 16:03:48 258 john accountant...

I am modifying a VB program that is taking ALL the tables from an ACCESS Database and converting them to a SQL DATABASE. They VB Program opens the SQL DATABASE, but I want to verify the database is completely empty. Is there a function or call that can be added to the code??

I build a sql-statement and put it in a local variable so i can execute it using sp_executesql, but a local variable cannot be a text or ntext data type, and a varchar data type cannot be used by sp_executesql. So the maximum lenght of the statement cannot be more than nvarchar(4000)... is there...

I'm trying to pull up information from an accounts payable database. I'm looking for amts paid that are the same and greater than one & vendors paid that are the same - where the amounts paid were on different check numbers. Any advice? Table contains these fields: VendorNumber, PONum, AmtPaid,...

Hi All, I have around 95 tables on FoxPro that I need to migrate on SQL7. These tables are stand alone data tables and are not part of any database as of now. I have tried exporting these tables into XLS format and then importing these tables to SQL7 using enterprise manager but there are certain...

I am try to write a query that will give me a list of ITems that have a a quanity of greater than 0 on hand and only latest date and Item was invoiced. Here is what i have come up with so far SELECT IV00101.ITEMNMBR, IV00101.ITEMDESC, IV00101.CURRCOST, IV00102.QTYONHND,SOP30200.SOPNUMBE,...

I have 3 tables. one of the tables is a linked table, so it contains the primary key from table 1 and primary key from table 2 as foreign keys. together they make up the primary key for the linked table. Now i need to find out which items are not in the linked table. example : table A contains...

To follow this tag...

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy