|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SQL Server database programmingmicrosoft.public.sqlserver.programming
Access SubQuery Help Needed.....................
Hexman -
7 Jan 2006 11:55 PM - 3 messages
Don't know if this is the proper newsgroup to post to. Sorry if not. Can't figure this one out. Using Access 2003. I have 2 tables, IMast (table of part info) and THist (part transaction history). ...
create new table based on union of range data
Cathy Smith -
7 Jan 2006 8:58 PM - 8 messages
Hi, I was hoping someone could help me out. Is it possible for SQL to take a table which has date range data (start and end date indicating the contract period of the client) and create a new table which creates a union of 'unionizable' range data for each specific ...
Connection closed durring application execution
Amir Shitrit -
7 Jan 2006 7:50 PM - 11 messages
I'm using Sql Server 2000 in my .NET application. Once the application created a connection, the connection seams to stay opened even after the server was stopped. Why is it happening, and it there a way for my app to get events when the ...
DateTime variables
Darren Rhymer -
7 Jan 2006 5:36 PM - 19 messages
Hi all Sorry if this is in the wrong place, please tell me if it is. I've got a SQL 2000 database and I'm having problems selecting rows where the value of a datetime column (with date and time) has to be less than ...
[OT] Job Posting
Mike Labosh -
7 Jan 2006 3:57 PM - 6 messages
We're having corporate layoffs here, so there's about 50 of us scrambling to find work. I just came across a post on dice.com where the company says that they have 50 years of leading edge experience in the IT Industry ( wha?) ...
A little advice about locks with SQL 2000
ChrisDangerfield -
7 Jan 2006 1:12 PM - 3 messages
Hi there, I am hoping someone can give me a little advice about locks. I have just finished reading a chapter about them in a reference book and i am now more confused than when I started. What I want to do is simple, i hope. ...
duplicate number
Trond Hoiberg -
7 Jan 2006 12:18 PM - 8 messages
I have a table with customers that is imported from Axapta 3.0. I have imported them into a table that is a clone of Axapta table. I see that i have rows where account number is the same. So it appears that ...
Cursor loop is broken
sblar -
7 Jan 2006 10:43 AM - 21 messages
In a stored procedure (SP1) I am looping through a cursor with records from Table1. Each record in the cursor is inserted into Table2. Insert trigger on Table2 is inserting the record into Table3 (in another DB). In the insert trigger on Table3, a series on checks are done on the ...
sql profiler vs. query analyzer
Gerard -
7 Jan 2006 10:30 AM - 6 messages
Hi, I'm trying to improve on a query in one of my scripts and noticed that execution time in query analyzer is several seconds where as in sql profiler the start and end time of the statements (including declaration of variables) is within the same millisecond. What am I to ...
INFORMATION_SCHEMA.SCHEMATA does not return all rows on SQL 2005
Pradeep -
7 Jan 2006 2:55 AM - 3 messages
Hi, In SQL 2000, the following query used to return all the database names: SELECT CATALOG_NAME FROM INFORMATION_SCHEMA.SCHEMATA However, in SQL 2005, it just returns "master" as the database (that too a number of times). Can someone please confirm if this is a bug in SQL 2005? ...
Alter column add constraint unique
Jeff User -
7 Jan 2006 12:57 AM - 9 messages
Is it possible to alter a table column data type AND add a unique constraint at the same time? I can get this to work ALTER TABLE tablename ALTER COLUMN colName DataType(optional size); and I can get this to work ...
Function Returns Data Type Error
Mike Harbinger -
7 Jan 2006 12:48 AM - 5 messages
I am writing my first function and it should be be a very simple one but I am getting the error: Server: Msg 245, Level 16, State 1, Procedure InvTypeUSR, Line 9 Syntax error converting the varchar value 'N' to a column of data type int. ...
Most efficient way to write this
Tim -
7 Jan 2006 12:33 AM - 5 messages
I have the following: ID Name 1000 Smith 1000 Jackson 1000 Fastow ...
Help with relational set division, please! Good challange!
Farmer -
7 Jan 2006 12:26 AM - 10 messages
/* Please help. Definition: I am trying to compose a query that will do part matching based on certain input criteria, by item class. I want to define a table called criteria and let users define sets of criteria that may satisfy a part match. if I have ...
can this query be cleaner or written better?
Rich -
7 Jan 2006 12:18 AM - 6 messages
Hello, Below are 2 tables and the data (fictitious). I have a pretend flower shop. I sell various kinds of flowers for 5 days (mon, tue...fri). First I want to get a grouping of flowers sold per day, then I want to identify/isolate ...
Int vs tinyint
tshad -
6 Jan 2006 11:00 PM - 3 messages
Is there a good reason to use int over tinyint for my look up table primary keys? I usually use int, but most of my look up table are 20 - 100 items max. I know one reason would be that you could not use a -1 as it is an unsigned ...
finding length of text field
HP -
6 Jan 2006 10:42 PM - 5 messages
I need to find the length of a text field.The len function doesn't work with text fields. Is there an alternative? Thanks! ...
Table grows at extreme rate but is not full
Steve Hughes -
6 Jan 2006 10:29 PM - 4 messages
I am looking for some ideas. We have a table that is growing from about 7GB to 40+GB but most of the space is unused. I am reviewing the insert proc that loads it. The part that is puzzling we use message queing to initiate ...
How to send variable to Oracle in a distributed query
Cindy Winegarden -
6 Jan 2006 10:06 PM - 1 message
Hi All, I'm working on a distributed query that connects two SQL Servers and an Oracle 10 data warehouse. I'd like to send a date variable in the WHERE clause of the the Oracle SQL string to replace the hard coded dates I'm ...
xp_SendMail and CHAR(13)
LCooker -
6 Jan 2006 9:45 PM - 2 messages
I'm having trouble using xp_SendMail and the char(13) constant in the @message parameter. When I try to send an email message that contains a char(13) in the @message parameter, xp_sendmail gives me a syntax error at the '+' character. If I remove the '+ char(13)' from the ...
create other index
Owen -
6 Jan 2006 9:27 PM - 6 messages
Hello: I create a key in one table, the field is uniqueidentifier, but I search very frequently for one [date] field, and I like to index this field with datetime datatype to optimize the search, how can I do that? ...
Update fails after IF EXISTS
Mike -
6 Jan 2006 9:13 PM - 4 messages
I would like to know if anyone else has had the same experience where the Update portion runs even though the IF EXISTS returns nothing. The sql with the select works fine. Here is the sample script. use tempdb go ...
xp_SendMail & Char(13)
LCooker -
6 Jan 2006 9:02 PM - 2 messages
I'm calling a stored procedure from Visual Basic 6.0 which uses xp_SendMail. The @message parameter was receiving a string variable which was built using vbcrlf constants to line feed the message. xp_SendMail would fail everytime I sent this string. If I removed the ...
Tracking Employees LogTImes
ninel g via SQLMonster.com -
6 Jan 2006 9:02 PM - 1 message
I have a table that tracks employees log times throughout the day for different projects. [code] CREATE TABLE LogTimes( EmployeeId varchar(10) NULL, Project VarCHAR(10) NULL , LogIn varchar(10) NULL, LogOut varchar(10) NULL, Time varchar(10) NULL) ...
Case stmt
HP -
6 Jan 2006 8:59 PM - 4 messages
I need some help in writing a case stmt in a where clause. The select query is, select fldnames from tablename where IIF(datefield1 is not null, datefield1, datefield2) > '01/01/06' I know iifs don't work in sql, it's just a pseudocode.I am trying to use ...
JOIN with table valued function very slow
Mark Williams -
6 Jan 2006 8:28 PM - 6 messages
If have a tabled-valued function uCalendar that returns a two-column table with attributes dayno (number of days past 19000101) and caldate, which is a formatted date based on dayno. DDL for uCalendar: CREATE FUNCTION uCalendar (@startdate datetime = '19000101', @enddate ...
Link Server settings
GB -
6 Jan 2006 7:59 PM - 4 messages
Hello: I am trying to create linked server ( another SQL Server) to my SQL Server, using Enterprise Manager, but new alias pointed me only to master database. How can I change settings of the link server to get access to pubs database? ...
OPTIMIZER LOCK HINTS
Mike L -
6 Jan 2006 7:43 PM - 10 messages
I want to populate ULF with all the records from ULF_Backup in my License database. I can't get around this error, "OPTIMIZER LOCK HINTS" Here is the SQL code I'm running from Query Analyzer. sp_dbcmptlevel 'license', 70 GO ...
Select most recent date time
Terri -
6 Jan 2006 7:42 PM - 15 messages
I am passing a datetime parameter to a select. DECLARE @TestDateTime DateTime SET @TestDateTime = '20050110' SELECT * FROM Table1 WHERE TestDateTime <= @TestDateTime There may not be a row with a datetime that matchs the parameter, in which case I want to select the next previous rows. I can't use top with an ORDER ...
A new group for statisticians has been formed. Request to join
madan -
6 Jan 2006 7:20 PM - 1 message
Hi, I have started a new group name "Statisticians_group" in the yahoo group for statisticians or the persons who are interested in statistics. The URL is [link] I am happy to announce that the group has already more than 600 members ...
sysname
Brian Henry -
6 Jan 2006 6:56 PM - 4 messages
What the heck does sysname do? There is nothing in the documentation besides saying "its a system name"... that doesnt tell me much at all. thanks! ...
trigger
JFB -
6 Jan 2006 6:25 PM - 3 messages
Hi All, How is the syntax for a trigger when someone insert or update one of the fields of my table? Any links? Tks in advance JFB ...
Managing DTS Programmatically
rmg66 -
6 Jan 2006 6:16 PM - 3 messages
Does anyone out there have any tip on managing DTS packages programmatically? Specifically, I want to install and run a dts package using tsql through query anyalyzer. I know how to run it using the xp_cmdshell, but I don't know how to install ...
Table load with duplicates on Primary Key in import file
CompDog -
6 Jan 2006 6:08 PM - 2 messages
I am attempting to load a table with a file that has duplicates on a composite primary key and only want to keep the newest record by a date field. Is there a way to do this with a query or will I need to set up ...
What Are The Issues With MS Access Client to SQL Server DB
Smithers -
6 Jan 2006 5:45 PM - 15 messages
I have a *potential* client that has an MS Access-based OLTP application. They currently have two .mdb files - one for the data that lives on a file server, and another .mdb file on each client workstation that contains the ...
Tool to find sqlserver and code dependences
john conwell -
6 Jan 2006 5:44 PM - 5 messages
Is there a third party tool that analyzes a database, then your code and links all dependencies, so if you change a view or sp, it'll tell you what code you should also check? ...
variable TOP value?
Jason -
6 Jan 2006 5:26 PM - 6 messages
Here's a programming puzzle for you gurus :-) 1) Is there any way to accomplish something like this in SQL? select top @topcount * from mytable I cannot use dynamic SQL because that will lock my stored procedure. I do not have a column in the SQL query that I can use to compare with (like ...
trouble using a user defined function
jason -
6 Jan 2006 4:50 PM - 10 messages
i have this function: CREATE FUNCTION user.split ( @list varchar(4000), @delimiter varchar(5)) RETURNS @listtable TABLE ( value varchar(100)) AS BEGIN WHILE (CHARINDEX(@delimiter,@list)>0) BEGIN INSERT INTO @listtable (value) SELECT value = LTRIM(RTRIM(SUBSTRING(@list,1,CHARINDEX(@delimiter,@list)-1))) ...
Performance - Joins vs Filters
Simon Woods -
6 Jan 2006 4:40 PM - 7 messages
Hi I reckon this is a "how long's a piece of string"-type of question but I'll try it anyway. If you could provide any pointers, even if it is not a direct answer then I'd be really grateful. ...
UPLOADING A TEXT FILE INTO A TABLE
mx -
6 Jan 2006 4:39 PM - 4 messages
Hello: Can anyone help me with this upload. I have a non-delimitted text file that i need to upload in a table. How do i separate the fields? Junior in SQL SERVER! thanks mx ...
Help - I need a book on SQL
JD -
6 Jan 2006 4:29 PM - 3 messages
Im trying to write a complicated SQL in analyser using several tables and sub selects to do some inserts. I have to do this very often and I only have a limited knowledge of SQL. Can you recommend a book I can go out and buy that will teach me how to ...
Check the continuity of dates
cxg -
6 Jan 2006 4:10 PM - 10 messages
I am trying to find coverage dates for a given list of dates that may have breakage. For example person 123 has the below records: PersonID Date 123 10/15/03 ...
Column X is same, column Y is different?
Rick Charnes -
6 Jan 2006 4:09 PM - 11 messages
Can someone point me in the right direction: How do I say: "Display all rows from MYTABLE where column x is the same but column y is different"? Thanks much. ...
Property QuotedIdentifierStatus is not available for UDF.. Help?
Essa -
6 Jan 2006 3:46 PM - 5 messages
Hi ; I'm using the release version of SQL Server 2005 tools (Microsoft SQL Server Management Studio 9.00.1399.00) and .NET Framework 2.0 (2.0.50727.42) on Windows XP SP2. My desire was to use the new tools against my existing SQL 2000 servers ...
SQL Server Instance Name
joey.powell -
6 Jan 2006 3:21 PM - 4 messages
I have installation of SQL Server 2005 where I must use the machine name to reference SQL server. I want to be able to use (local), but it doesn't work. How can I make it work? ...
Imbedded subroutine prefix error
tshad -
6 Jan 2006 3:16 PM - 18 messages
I am trying to run this routine which works fine until I put the outside Select in. The function consists of 4 Select statements that I need to do to get counts of various comparisons in my tables. The problem is that the ...
Database backup stopped and Can't Kill SPID
Sean John -
6 Jan 2006 3:13 PM - 1 message
I created a full database backup on my SQL2000 database and it hung at the last to bars and wouldnt complete. I canceled the job and its been rolling back for over 5 hours. How can I stop the main SPID? ...
Enterprise manager compatibility
Igor Solodovnikov -
6 Jan 2006 2:53 PM - 3 messages
Hi I trying register SQL Server 2005 Express Edition instance in Enterprise Manager 2000 without success. Enterprise Manager 2000 do see instance and lists its name in the list of available servers. But connection check returns error: "SQL Server does not exist or access denied. ConnectionOpen ...
DELETE Trigger
Redowl -
6 Jan 2006 2:34 PM - 6 messages
Hi, I am pretty sure this is fairly straightforward, I would like to use a trigger to delete an existing record from a table where the value of certain fields match those of the record to be inserted. Thanks. ...
identify 'next' pk value
chandy -
6 Jan 2006 2:16 PM - 12 messages
Hi, I want to 'move' a row up or down in a table (pk not carried with it). Strikes me that the easiest way to accomplish this is to copy the values for that row and the row above or below into variables then do ...
FOR XML performance question
Lee -
6 Jan 2006 12:53 PM - 5 messages
I am currently rewriting a data access component to make use of the FOR XML SQL statement to return XML data as an ADO stream from a specified source. The older current component requests this data using an ADO recordset and ...
NULL in Joins
VinceKav -
6 Jan 2006 12:05 PM - 13 messages
I have converted some legacy SQL to use the newer JOIN syntax, however the original SQL returns the required NULL values for the RolesToLinksXRefID column, but the newer SQL doesn't. --OLD SQL Select T.TempID, FT.Message, L.LinkID, L.LinkCaption, RLX.RolesToLinksXRefID ...
extract non-unique records from a table
Shekhar Gupta -
6 Jan 2006 12:01 PM - 3 messages
Can anyone pls help me with any SQL syntax / logic of extracting only the non-unique records from an SQL table ? Thanks Shekhar ...
default column value
gary -
6 Jan 2006 11:44 AM - 3 messages
as current time.. how can i set that in mssql 2005 ? ...
Memory problems using Sql Server 2000
Edward Diener -
6 Jan 2006 9:07 AM - 18 messages
I have an application which is inserting/updating upwards of hundreds of thousands of records into a SqlServer table. I am using ADO, make my ADO connection, then use ADO commands to insert/update each record as appropriate. At the end of the insert/update I release the connection. I ...
Installing Reporting Services on Win 2003 Server with error message "The key 'ReportingServices.WebS
Jonathan Chong -
6 Jan 2006 7:11 AM - 2 messages
This question has been posted in sqlserver.reportingsvcs forum but it receives no respond. So I try my luck here: I have SQL 2000 reporting services installed on Win 2003 server. I am able to logon to Report Server but when I tried to logon to Report Manager it ...
Rolling Back deleted Data
Yogesh -
6 Jan 2006 4:56 AM - 4 messages
Hi Guys If i deleted a table data without taking query in ant transaction. Could it possible to recover data ? For Example I wrote query Delete From Table_A where Column_A ='SomeValue' but i forgot to add another condition and delete more recordes than needed ...
strip nulls out of image column
news.microsoft.com -
6 Jan 2006 3:48 AM - 3 messages
How can I strip or replace values in a an image column, for example, if I select the data in an image col that returns the following x25005000440046002D00... how can I strip out all the '00's to end up with ...
Using ADO to duplicate records.
iftbill -
6 Jan 2006 2:13 AM - 2 messages
I need to know the best way to code using vba to read a few records from an Sql database(one table), modify these records then add them as new records to the same table. Thanks, ...
Median Calc
Craig -
6 Jan 2006 1:21 AM - 6 messages
I'm trying to use the following to calculate the median by year for the field "labor_rate". This should calculate the median for any year where the count is ODD. I haven't started on the "ELSE" part to calculate when the counts ...
Local Temporary Table Bottlenecks?
Fabuloussites -
6 Jan 2006 1:08 AM - 3 messages
Greetings, I'm fairly new to stored procedures and temporary tables and i was going through this tutorial for a banner ad system. [link] it's a nice write up, how over i'm concearned over some of its logic. In ...
Stored procedure creation terribly slow until reboot
Steve H -
5 Jan 2006 11:17 PM - 3 messages
Greetings! We were running into an issue with creating a stored procedure that was around 1400 lines long (calling other procs in the process). The stored procedure creation would take over an hour to complete - note that this is just the Create proc statement. The database had many tables, some ...
SQL Server Management Studio Express
Roberto Hernández -
5 Jan 2006 10:53 PM - 5 messages
SQL Server Management Studio Express is free like SQL Server 2005 Express edition ? ...
designing history tables
sqlster -
5 Jan 2006 10:41 PM - 5 messages
Could some one please point me to a good resource on how to design history tables in a dataware house situation?? For example, in the case of products table, if product description got changed over time after the product was purchased. The old invoice still ...
Results of EXEC into table?
Michael Bray -
5 Jan 2006 9:24 PM - 3 messages
I have a feeling I already know the answer to this, but is there any way that I can use the results of an SP in another query? In other words, I have an SP that outputs a table, and I want to use that table as an input ...
Indexed Views in Enterprise Edition...?
JM -
5 Jan 2006 9:03 PM - 4 messages
We are using SQL Server 2000 Standard Edition. Among other things, the "Enterprise" edition adds "indexed views". Could someone tell me what indexed views are, and what they are good for? Is this simply an index on a view? Do the underlying tables have to be ...
multiple inserts in transaction
sqlster -
5 Jan 2006 7:59 PM - 13 messages
I am trying to insert into multiple tables and if any of the inserts fail, I would like to rollback the entire thing. This approach works but is it a good design?? Please let me know. declare @err int declare @id1 int ...
Need some feedback. What do you think about storing my data like this?
Star -
5 Jan 2006 7:38 PM - 4 messages
Hi, I need to store a hierarchy in my database (a tree) I have 3 types of data: Cases, Groups and Users. I can have any combination of them. Check the following link ('Groups', 'Cases', 'Users' and 'Tree' will be ...
Joing two tables but avoid cartesian product
John Francisco Williams -
5 Jan 2006 7:37 PM - 14 messages
Hi all, I have two tables that don't have any common data: [Table1] Column11 Int AnotherColumn Int [Table2] Column21 Int Data: [Table1] Column11 | AnotherColumn ...
Dynamic SQL Column Total Help
LJohnsonNG -
5 Jan 2006 7:08 PM - 14 messages
am trying to dynamically determine the number of Active Projects in a given month dynamically for a give ProjectType. (e.g. For June 2005, I would like to see all projects created on June 30, 2005 or before that have not yet closed grouped by Project Type.) ...
Datetime constraint: is there a better way to do this?
BLetts -
5 Jan 2006 7:06 PM - 8 messages
I have a table that contains a datetime field. It's meant to keep track of monthly equipment inspections. There can be only one inspection per month, and I need to keep track of the day it happens. Currently I have one datetime field that keeps track of the ...
Unique transaction identifier
Adrian -
5 Jan 2006 6:51 PM - 2 messages
Hi there, I'm putting together a simple database auditing system (on a SQL 2005 system), using triggers to capture database changes and logging them to a set of shadow tables. I need to also capture transactional information; that is, be able to group the captured changes by their respective transactions. ...
Calculate Median
Craig -
5 Jan 2006 6:31 PM - 7 messages
I'm using SQL 2005. I would like to calculate the median (middle value in a dataset) in either transact SQL or by using a function. Any suggestions? Thanks. ...
make 1 record with Union statement
Susanna -
5 Jan 2006 6:20 PM - 3 messages
Hi there, I've made a join query: SELECT B.ITEMDESC AS ITEMDESC, A.ITEMNMBR AS ITEMNMBR, 0 AS 'SUM QTYORDER', A.QTYONHND AS 'QTYONHND' FROM IV00102 A LEFT JOIN ...
Self Referencing Table question.
Paul.Hawkes -
5 Jan 2006 6:14 PM - 6 messages
Below is my DDL. The table is self referencing. The foreign key reference is bfhvT_ParentSID which references bfhvT_SID ---Start CREATE TABLE [dbo].[tb_bfhvTest] ( [bfhvT_SID] [int], -- THis IS MY IDENTITY (The Real table has an Identity Column .....I Promise) ...
Add a field
Jeff Cichocki -
5 Jan 2006 6:01 PM - 31 messages
I need to add a rowguid to 300+ tables. Is there a way to script it? Thanks Jeff ...
Problem - Division between floating numbers
juanca -
5 Jan 2006 5:52 PM - 2 messages
Hi, I have a problem to divide two numbers type float, and for 100. The problem is it to use the function the ROUND in the result. The example is the next: declare @m1 float declare @m2 float declare @w1 float ...
external/unsafe access assembly in SQL 2005
Ken Abe -
5 Jan 2006 5:50 PM - 1 message
I get the following error when trying to load my assembly, eventough the first condition is met: "CREATE ASSEMBLY for assembly 'test' failed because assembly 'test' is not authorized for PERMISSION_SET = EXTERNAL_ACCESS. The assembly is authorized when either of the following is true: the database owner (DBO) has EXTERNAL ...
SQL 2005 Compatability in a View
Tony -
5 Jan 2006 5:40 PM - 9 messages
I have started to migrate our SQL 2000 tables and views to our new SQL 2005 box. One thing that I have noticed is that one of our DB's is still at 65 for compatibility. I have now migrated the DB and found that certain things ...
Executing Dynamic SQL with update
Ayoa -
5 Jan 2006 5:35 PM - 2 messages
I have a temp table #Temp(id int, statement varchar, result int) The statement column contains a prebuilt sql select statement e.g id statement Result 1 select count(*) from books where authorname like 'A%'. ...
Trigger Question in Sql 2005
Bob -
5 Jan 2006 5:29 PM - 5 messages
I have two triggers that execute on update, Trigger 1 also executes on insert , I need it to check to see if an update is allowed ALTER trigger [trg_Mytable_ins_upd] on [dbo].[MyTable] for insert, update as set nocount on; Declare @IsClosed bit ...
Locking while updating
kt -
5 Jan 2006 5:10 PM - 4 messages
We are currently using VB to create order numbers. Each user requests an order number as and when required. The problem is that the next in the sequence seems to be allocated on the odd occasion to more than one user. ...
Query with "not null"?
dew -
5 Jan 2006 5:03 PM - 6 messages
Is there a way to do a query and include a field if it is *not* null? For instance, I know I can: Select LastName + isnull(FirstName, '') from tblClients I want to include a field only if it isn't null, for instance, if a client ...
Select whole numbers in decimal field
Terri -
5 Jan 2006 4:54 PM - 5 messages
I have a decimal field. Decimal (18,4) How can I only select whole numbers from this field or vice versa? Thanks ...
getdate
Steven Scaife -
5 Jan 2006 4:48 PM - 9 messages
Hi I have to create a series of reports that look back over certain days ie. day before current week current month, quarter, year The reports will be scheduled to be run between the hours of 10pm to 6am when the business is shut. ...
Views and indexes
Tumurbaatar S. -
5 Jan 2006 4:41 PM - 3 messages
Do I need to create indexes on a view to speed up ordering and searching, if tables already have needed indexes? For example, if I specify ordering on some column of a view (or searching on this column) and a source table ...
Question about storing a tree in the database
Star -
5 Jan 2006 4:38 PM - 4 messages
Hi, I have been researching for a while about ways of storing trees in a database. I found a nice solution in the following page (there are 2 actually, I'm talking about the second one) It starts when they talk about creating this table: ...
Having problems with distinct and count
Sai -
5 Jan 2006 4:31 PM - 2 messages
Hi, Here is the query I am trying to achieve and having syntax issues Select count(distinct name, number) from results. To replicate the situation use the following SQL create table results (name varchar(100), number int) insert into results values ('test1', 1) ...
update query syntax question
astro -
5 Jan 2006 4:10 PM - 4 messages
I should know this.......(so now's the time to figure it out I guess) I want to update a table based on a query like update table1 (select col2, col5, col6 FROM table2 WHERE <<some condition here>>) ...
simple insert of strings
Mark in Miami -
5 Jan 2006 4:04 PM - 11 messages
I'm trying to validate to run the following statments. I have several special characters that aren't being accepted as the string to insert. I'm pretty new to the SQL syntax and string limitation, can someone please review ...
Avoid Looping / Cursors. Help with Statement.
craig.parsons -
5 Jan 2006 3:48 PM - 6 messages
Hi Folks, I have two tables, one of which I want to update from another. Essentiall I have a table of orders and a product table. I want to subtract the qty sold in the orders table from the QtyInStock column in ...
If exists from within a select statement.
benbibbings -
5 Jan 2006 3:46 PM - 2 messages
I have a simple SQL statement, I need to populate columns from several tables. I need to populate some of the columns depending if there is data in a child table that matched the parent table (a one to many relationship). ...
SQL2000 can a generate an incremental row #?
__Stephen -
5 Jan 2006 3:42 PM - 6 messages
I just got a request for combining a date, with an incremental to generate a job #. I hate the idea but then when do we think this up anyway? Here is what I'm playing with as of now from one of my developers: ...
Computing several columns for each row in source table and joining to get result
dustbort -
5 Jan 2006 3:33 PM - 3 messages
I have come across this several times now, and I cannot figure out how to do it better. Say I have a simple table called SourceTable: DECLARE @sourceTable TABLE ( data1 INT, data2 INT, ...
SQL 2005 Default instance does not show up in server lists
Brian Henry -
5 Jan 2006 2:51 PM - 6 messages
Have a slight problem, When I view the lists of servers on our network in managment studio, our SQL Server 2005 default instance does not show up in hte list... we have two instances running... default instance and one named ...
Complex Query
MKing -
5 Jan 2006 2:51 PM - 16 messages
Need to create a SELECT statement which is above my skills. There are two tables involved, both are shown below. Table 1 stores messages to be delivered to a user on a web page. Messages can be sent to a specific set of ...
Division query
NAVIN.D -
5 Jan 2006 1:42 PM - 5 messages
i have an equation which i have to implement in query: availa= (1-[return0]/sum(r1+r2+r3+r4+r5)) when tried the query i get avail as zero always, help me out ...
adjust my code
Jason -
5 Jan 2006 1:28 PM - 9 messages
Hi, I've created this code to determine the dates for an exam when a certification must be met within a X number of months or years. The last deadline date for an exam is the enddate. The marge where one can ...
SQL 2005 and weird SP performance problem
johnsolver -
5 Jan 2006 1:21 PM - 8 messages
Hi, I've posted this message previously on sqlserver.server but somebody mentioned that it might be related to fulltext (though I don't think so) so I'm posting it here now. I recently migrated my DB to SQL 2005 from SQL 2000, the ...
avoid using cursors....
jagb -
5 Jan 2006 12:48 PM - 7 messages
I am trying to rewrite a sp that I created years ago to avoid using cursors so there is no problems with mutiprocessor systems and parallelism. Simplifying, we have an order table and task table for each order: CREATE TABLE [TOrders] ( ...
|
|||||||||||||||||||||||