Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score How many rows exist in these two tables.
Tony Johansson - 2 Jul 2005 11:45 PM - 7 messages
Hello Experts! The question that I want to have an answer to is how many rows does the Person table have and how many rows does table Car have. No matter if the Persons own a car or not and the same if the car have a owner or not. ...
Score Problem with a job
Mark - 2 Jul 2005 9:10 PM - 3 messages
Hi - I have a really simple job I want to run: BACKUP DATABASE dbusers TO DISK = "D:\SQLServerBackups\users\dbusers.bak" ...but it fails.  There is nothing in the EM log files - is there somewhere else (other logs) which will let me know why it's failing?  Is ...
Score SELECT, INSERT, UPDATE
erncelen - 2 Jul 2005 4:47 PM - 10 messages
A douby that arise.... I'm buiding a series of SQL statement (SELECT, UPDATE and INSERT) comparing table.... e.g.: UPDATE ztemp SET tables=z.tables, colors=z.colors FROM z as z INNER join ztemp as zt ON z.ID = zt.ID ...
Score using Identity property
anoop - 2 Jul 2005 3:48 PM - 25 messages
Hello,          please give me the syntax to add or drop the Identity property for a column in a table using Alter table statement.                                                       Is the syntax ...
Score Problem With Stored Procedure
Wayne Wengert - 2 Jul 2005 12:28 PM - 14 messages
When I execute the stored procedue shown below it never returns any values? Howevber, if I execute the Select portion in QA and plug in the value for @eventlist and set @gemus to 1, it returns the correct 2 email addresses but ...
Score Server: Msg 2627, ...Violation of PRIMARY KEY constraint
erncelen - 2 Jul 2005 10:52 AM - 3 messages
When I try to update a table I receive the following message Server: Msg 2627, Level 14, State 1, Line 1 Violation of PRIMARY KEY constraint 'PK_BP_STEP_LINKS'. Cannot insert duplicate key in object 'BP_STEP_LINKS'. The statement has been terminated. I have set NOCHECK CONSTRAINT ALL before executing the statement ...
Score Incorrect syntax near '+'!
Arpan - 2 Jul 2005 9:16 AM - 3 messages
What's wrong with the following code? EXEC xp_sendmail     @recipients***@b.com',     @copy_recipients***@c.com;*@d.com;*@e.com',     @subject='SQL Server Report!',     @message='Report generated on' + CAST(GETDATE() AS varchar(50)) + '!', ...
Score SQL Mail
Ed - 2 Jul 2005 4:56 AM - 2 messages
Hi,   After I setup the SQL Mail, and make sure it works fine, do I still need to start up the SQL Server and Agent as the same account that i log in to the Windows Server? Thanks Ed ...
Score paramaeters in SP
Stuart Hawkins - 2 Jul 2005 4:12 AM - 7 messages
Hi, I have a Select query I have put in a stored procedure.  What I would really like to do is pass it parameters that tell it not only the values to filter by but the fields to filter on too (choice of three including combination of ...
Score 'SET IDENTITY_INSERT ' + @TablesName + ' ON' doesn't work in store
erncelen - 2 Jul 2005 2:30 AM - 8 messages
Hi, I have a big problem: If I try to execute SET IDENTITY_INSERT as below, DECLARE @SqlCheckIdentity varchar (255) SET @SqlCheckIdentity = 'SET IDENTITY_INSERT ' + @TablesName + ' ON' EXEC (@SqlCheckIdentity) Or DECLARE @SqlCheckIdentity varchar (255) SET @SqlCheckIdentity = 'SET IDENTITY_INSERT ' + @TablesName + ' OFF' EXEC (@SqlCheckIdentity) ...
Score Problem to understand a select question
Tony Johansson - 1 Jul 2005 11:01 PM - 2 messages
Hello! Some background we have two tables one Person and one Car. The relation is that one Person can own one or at most two cars. How should the number 198898 and 114388 be understood. What information does these two numbers give. ...
Score communication failure to linked server
Wm - 1 Jul 2005 10:36 PM - 1 message
I have a stored procedure that must execute a stored procedure on a linked server.  If the linked server is there, no problem.  But if the linked server is missing for some reason (like it's down), the calling SP bombs ...
Score Locks
Mike Labosh - 1 Jul 2005 9:40 PM - 4 messages
In EM, under Management -> Current Activity -> Locks / Object, I have a table that shows 4,621 Page locks (which I think is ok, because they are all me, and I'm currently waiting for a bit fat batch to complete.  But on the ...
Score Beginner Q: Relationship and Updates/Deletes
matthias s. - 1 Jul 2005 8:59 PM - 4 messages
Hi there, for testing purposes I've created two tables, Authors and Books (table defs at the end of the message). I have a one to many relationship between them (1 Author can have n Books). My question is: how do I delete an Author from the table? Do I have to start ...
Score is there a table function for first occurence of a string?
Rich - 1 Jul 2005 8:41 PM - 3 messages
If a table contains 120 columns and contains data that is about a specific subject matter - is there a way to search for the first occurence of a string like "bipap" or "bi pap"?  The thing is that you don't know what column would ...
Score Update Query Question
RitaG - 1 Jul 2005 8:36 PM - 6 messages
Hi. I have a SQL 2000 table (Table1) whose 1 column (column1) I need to update. I have to match Table1.Column1 to the column of another table (Table2.Column1) and if a match is found I'll update Table1.Column1 with ...
Score Design Suggestions for "marking" databases?
Tore - 1 Jul 2005 6:34 PM - 3 messages
I have an application that will be working with multiple databases (same design different data).  At the moment, I list the available SQL Servers, as well as the existing databases when a user selects one of the servers.  The ...
Score full text indexing on binary fields
Brian Henry - 1 Jul 2005 6:24 PM - 5 messages
i want to store PDF files in a database, but yet still have them full text searchable by the database... I have the adobe PDF IFilter interface installed and registered on the SQL Server box which is to allow for full ...
Score a little join help
Kurt Schroeder - 1 Jul 2005 6:01 PM - 5 messages
can anyone help me to join these two queries. they each work, but i'd like just one query. select count(u.usrSecID) as isthere from usr u join sec s on s.secID = u.usrSecID and s.secUserID = 'Kurt' ...
Score Date Formatting
tshad - 1 Jul 2005 5:40 PM - 6 messages
This is always annoying.  I am always trying to remember the best ways to display my date and cannot remember the formats or how to set up a custom format in Sql. At the moment, I am using DateDisplay = convert(varchar,e.DateSent,0) to ...
Score Data type issue in vb.net wrt sql server 2000
Rajesh - 1 Jul 2005 5:09 PM - 2 messages
I had created a user defined data type in sql server 2000 as follows         Length      Prec     Scale AMTTYPE       9    15     2    ...
Score A floating point exception occurred in the user process.
Daniel Paull - 1 Jul 2005 3:25 PM - 4 messages
I periodically receive the following error message: A floating point exception occurred in the user process. Current transaction is canceled I'm running SQL Server 2000 Standard Edition, sp4. I am running an Online Browser Based Game with SQL as my backend, i have 2 ...
Score Calling stored proc within a stored proc - both have parameters
TroyS - 1 Jul 2005 3:08 PM - 6 messages
I have the following: CREATE proc_1    @fromdate datetime    @todate datetime AS ..... ..... ..... INSERT #temp_table EXECUTE dbo.proc_2 (note, proc_2 has a 2 date parameters to supply as well; i'm trying to figure out how to pass the 2 date ...
Score problem with context info
Ram - 1 Jul 2005 3:05 PM - 6 messages
Hi I have a problem with reading value from context info. I am setting the context info using the following code. CREATE PROCEDURE dbo.SPOC_SETCONTEXTINFO ( @INFO nvarchar(20)  ) AS SET NOCOUNT ON DECLARE @BinVar VARbinary(20) SET @BinVar = CAST(RTRIM(@INFO) AS VARBINARY(20)) ...
Score Undo Functionality
Mike Labosh - 1 Jul 2005 2:59 PM - 9 messages
One of our developers wants to implement undo stuff in the data tier.  His idea was to make a trigger on a table that loops over the columns in [inserted] and [deleted] to compare the values, find out what changed to ...
Score Stuck on a Query
Wayne Wengert - 1 Jul 2005 2:21 PM - 3 messages
I have 3 tables involved TblA   NameID  int  PK   EmailAddr  varchar(65)   ..... TblB   ContactID  int   PK   NameID   .... TblC   EventID    varChar(10)   PK ...
Score How to split a column
Sidelo - 1 Jul 2005 2:01 PM - 8 messages
I need MSSQL to split a column to different columns The table had two columns: ID    Message 1    Lastname: Siderius                 Firstname: Lourens ...
Score Snapshot of data
C-W - 1 Jul 2005 1:54 PM - 9 messages
I was wondering if something along these lines is possible in SQL Server... We have a table which contains a particular record.  This table also has lots of related tables.  I would like to take a snapshot of a particular ...
Score Need help with a query
Glen K - 1 Jul 2005 1:45 PM - 4 messages
Say I have a table that contains pricing information for some products as well as a count of the number of retailers selling at that price: product_id price freq Is there an easy way to get the lowest price for a product AND it's ...
Score Calendar table
Bill Nguyen - 1 Jul 2005 1:44 PM - 5 messages
I would like to create a calendar table starting with a base date such as 01/01/2005. The table shouldd have the following columns for each row: column    Example Date     1/1/2005 ...
Score Transaction in SP
Ed - 1 Jul 2005 1:17 PM - 7 messages
Hi,   Is it necessary to put Begin Tran right before another calling SP? e.g. Begin Tran   Exec SPName     If @@Error <>0       Rollback Tran     Else ...
Score Stored Procedure for update : update selected fields depending on indicators
sven.maes - 1 Jul 2005 1:16 PM - 3 messages
Hello, is it possible to create a stored procedure with parameters, so that you can say for example : update table if @indicator1 = 1  then set field1 = @field1 if @indicator2 = 1  then set field2 = @field2 ..... where keyfield = @keyfield ? thank you, ...
Score select name from sysobjects where ......
Henrik Skak Pedersen - 1 Jul 2005 12:56 PM - 3 messages
Hi, Is there any difference in the result of these two queries? select name from sysobjects where OBJECTPROPERTY(id, N'IsUserTable') = 1 order by name select name from sysobjects where sysstat & 0xf = 3 order by name Thanks Henrik. ...
Score Date part only without using Convert(char.....)
NH - 1 Jul 2005 11:44 AM - 11 messages
select convert(char,getdate(),101) will return the date without the time part. Is there a way doing the same without converting it to a char? I need the date part only but it must be a datetime data type. ...
Score Mirgration Q.
Ed - 1 Jul 2005 11:28 AM - 2 messages
Hi,   I have a database migration question.  If I have a brand new database, I believe I can easily use dettach/attach or backup/restore to move database from Development to Production Server.  If I already have an existing ...
Score Database setup for a suite of applications
Craig HB - 1 Jul 2005 11:19 AM - 4 messages
We are developing a suite of web applications for restaurants, which include an inventory app, cash-up app, staff timesheets app etc. The applications are built with ASP.NET and the database is SQL Server 2000. All these applications use application-specific tables (like the Timesheets ...
Score LIMIT Command
Wayne Gibson - 1 Jul 2005 11:17 AM - 8 messages
Hi, I'm looking at using MS SQLServer 2005 and having some problems with the LIMIT command that I used in MYSQL. It doesn't appear to exist in MS SQLServer 2005, anybody know what the command is in MS SQLServer.. ...
Score SELECT TOP problem
B.J. - 1 Jul 2005 11:16 AM - 3 messages
Hi, I want to do select top n rows but n is variable : SELECT TOP @MyVar ID FROM Table; Because I get @MyVar from SELECT @MyVar=COUNT(*) FROM Table WHERE ProfileID=@ProfileID; which is not constant. But this does not work. Any suggestions, please. ...
Score DATEDIFF ignoring weekends
Mark Rae - 1 Jul 2005 11:01 AM - 3 messages
Hi, Is there an easy / built-in way of calculating the number of hours between two dates, but ignoring weekends? E.g. To calculate the number of hours between midnight this morning and midnight on Monday morning, I might use: ...
Score flatten rows into a variable
MrMarteng - 1 Jul 2005 10:49 AM - 2 messages
Hi! Does anyone know how to flatten rows into a variable using sql in a stored procedure? Such as getting a rowset  like this : SELECT ID FROM SOMETABLE ID ---------- 1 2 3 4 5 6 7 And somehow get a variable containing 1234567 ...
Score Auto incrementing numbers
mark - 1 Jul 2005 10:39 AM - 3 messages
Hi I have two tables (header and child) with a relationship between them. Each time I insert a row into the child table, I want to have one of the columns auto increment. I can't use an identity column (at least I ...
Score How to get data when SqlException.Class < 16
Rudi - 1 Jul 2005 9:48 AM - 1 message
Hi, I have a master proc that calls a different 'child' proc for a set of records. When a Raiserror occurs in the child proc, I 'handle' it in the master proc and update a status field in the record to 'Error' and set the returned ...
Score New Question - Joining Ranges - URGENT
Kathy - 1 Jul 2005 9:11 AM - 3 messages
Hi All For those of you that have not perhaps seen this - I need to join and lookup on a range of values Does anyone have a better / quicker cleverer way of doing this ok here is the scenario We have a lookup table with IP addresses and Countries ...
Score CASE Statement
Wayne Gibson - 1 Jul 2005 8:38 AM - 9 messages
Hi, Was wondering if somebody could tell me if it is possible to use a CASE statement within in the WHERE clause. I'm looking to create a store procedure that can a number of parameters. Then depending on the parameters that were passed, define the correct WHERE ...
Score Execution Plane Analysis
DMP - 1 Jul 2005 7:40 AM - 2 messages
Hi, Can Any one give me the reference of an article or web site from where I can get the proper idea  about  Execution  Plane  Report ? ...
Score Undeclare a local variable?
Andy Bretl - 1 Jul 2005 7:17 AM - 5 messages
Hi All, I have a quick question regarding the use of local variables. Actually it is more a cosmetic problem than a real one but I just wondered if it is possible to: UNDECLARE / REDECLARE a local variable? ALTER doesn't work and DEALLOCATE is for cursors only... ...
Score passing variables to functions in openquery
Kavie - 1 Jul 2005 6:36 AM - 3 messages
how can i pass a declared variable like @myVar to a function which is inside a package in an Oracle DB I am running the script from "SQL Query Analyzer" Part of the SQL server script is like this: set @stat = (select * from openquery(MYLINKEDSERVER, 'select ...
Score HowTo: Summarise Verticle Data Horizontally
Richard Myers - 1 Jul 2005 4:10 AM - 2 messages
Hello, Im hoping someone can help me with the following problem: I have a table consisting of three fields (CustomerId, City, QAType) where QAType is a discriminator with (n) possible values. I want to run a select query that takes all the rows in the table and groups ...
Score Why and How to Solve it?
Bpk. Adi Wira Kusuma - 1 Jul 2005 2:25 AM - 2 messages
I've tried execute "rebuildm.exe". But its proses is never stop, so look as be hung. Because of it, I restart computer by standard method (not turn reset at PC). Then I try to start SQL Server, But can't  run. ...
Score How to count more than occurances of a condition
J-T - 1 Jul 2005 12:11 AM - 2 messages
I have a table with the following columns: EnrollmentID,StudentID,Course_Code,Course_Session,Course_Year I'd like to get EnrollmentIDs which have more than one occurance of the combination of  (StudentID + Course_Code + Course_Session + Course_Year). I know I can write two selects and in the inner one group by StudentID + ...
Score [OT] (maybe not) It's All About Redundancy
Mike Labosh - 1 Jul 2005 12:07 AM - 3 messages
I work for a huge multinational corporation.  After many hours of mysterious downtime playing Doom and Age of Empires corporate-wide, I just got this email from the MIS Suits. [my comments in square brackets]: <email> At approximately 2:00pm this afternoon an electrical breaker in the Horsham ...
Score Strange Date/Time problem
Shapper - 30 Jun 2005 11:18 PM - 2 messages
Hello, I am having an error when inserting a record in an Access database. The field [publication_date] is of Date/Time type. This is my query and the parameters for that field: Dim queryString As String = "INSERT INTO [t_news] ([title], [text], ...
Score calculations sql server versus vb.net
Rajesh - 30 Jun 2005 11:06 PM - 2 messages
Hello Sql Gurus, I had a calculation    999999999999.99 * (7.00 /100 / 12) * 6 sql server    gives        34999997999.99965000002    vb.net    gives        34999999999.999649 (tried in debugger) ...
Score error
Fab - 30 Jun 2005 10:49 PM - 2 messages
I get the following error when i try to run a query on a linked server. Executed as user: Job Owner. SQL Web Assistant: Could not execute the SQL statement. SQLSTATE 42000 (Error 16805) Associated statement is not prepared SQLSTATE ...
Score Scheduling SQL Profiler
Lontae Jones - 30 Jun 2005 10:19 PM - 2 messages
Hello I would like to schedule my trace QSTRC which has the following events daily from 8-5: Locks -Lock:Deadlock -Lock:Escalation Stored Procedures -SP:StmtStarting TSQL SQL:BatchStarting ...
Score INSERT SQL Error. What is wrong?
Shapper - 30 Jun 2005 9:43 PM - 2 messages
Hello, I need to add a new record to an ACCESS database. I get the error: Syntax error in INSERT INTO statement. I have no idea what am I doing wrong. This is my code: ' Set Connection   Dim connectionString As String = AppSettings("connectionString") ...
Score Correct syntax for stored procedure
D Mack - 30 Jun 2005 9:35 PM - 4 messages
I am trying to gather information by comparing two tables.  Table A and Table B both have the field shop_person.  Table A is the entire list of employees, table B contains data about attendence, designated by a code.  I want to ...
Score Begin Next End problems?
Oded Dror - 30 Jun 2005 9:13 PM - 2 messages
Hi there Please take a look at this code USE Northwind GO DECLARE @Index INT SET @Index = 0 WHILE @Index <= 8          BEGIN    SET @Index = @Index + 1    SELECT TOP 2 * FROM Employees ...
Score Accessing data inside of a cursor..... to create new records....
MCSETrainee - 30 Jun 2005 8:58 PM - 6 messages
Hello Folks... I have a little problem.  I have a table (900,000 rows).  I need to select x rows based on a field value( no problem so far). I set up a cursor to get the data ... declare cursor JJJ  fpr Select * from ...
Score Case Statement?
DBA - 30 Jun 2005 8:36 PM - 17 messages
I am trying to write a simple sp that will depending on a value run different queries. e.g begin case when a=1 then select * from b else select * from c end end something like that been working on this for a while, any easy way ...
Score UPDATE problem
Ron Hinds - 30 Jun 2005 7:47 PM - 5 messages
I'm trying to update my Inventory table with the Vendor ID of the vendor that has given us the lowest quote on each partnumber. I created this View to get the appropriate data from the VendorQuote table: CREATE VIEW vVendorQuoteTemp AS ...
Score Adding non-table field to a view?
simon - 30 Jun 2005 7:43 PM - 7 messages
Is it possible to add a non-table field (i.e. a new field that does not belong to any table) to a view? I am trying to avoid creating a brand new table with just one field so that I can add it to the view. ...
Score Question for the Gurus
Chris - 30 Jun 2005 7:20 PM - 3 messages
Hi, If I have the foll table table1 1 2 3 4 how can I write a select statement to display the data in one row as 1,2,3,4 Thanks ...
Score JOIN question
Tim Johnson - 30 Jun 2005 6:51 PM - 5 messages
I have ORDER records that can have 0 or more associated ORDERNOTE records.  A CODE in ORDERNOTE tells me if a certain condition is true.  So I might have this: ORDER1  / note1-code12 / note2-code7 ORDER2 ORDER3 / note3-code7 ...
Score Need to select datta from Multiple databases using Query
Sam - 30 Jun 2005 6:45 PM - 4 messages
I am trying to do a Select * from (all tables where the table name begins with a letter P) I need to export data using Query and do not have access to Enterprise Manager so I want to select multiple tables using Query Analyzer. ...
Score Add a Record to a Database? Thanks.
Shapper - 30 Jun 2005 6:15 PM - 3 messages
Hello, I need to create a new record in an Access database. The database has 3 fields: [id] (autonumber) [title] (string) [text] (memo) [publication_date] (DateTime) When I create the record how should I create the [id] value? Does the database insert it automatically? ...
Score Debugging SP in 2005
Farmer - 30 Jun 2005 5:38 PM - 8 messages
Hi everyone, I installed SQL 2005 and I am testing it now. I can't seem to find an easy way of debugging procedures any more. In SQL 200 query analyzer, one can right-click and there is Debug option there. Where did it go now? ...
Score Strange: is null doesn't work when multiple CPUs are used.
James Ma - 30 Jun 2005 5:35 PM - 4 messages
Hi, This is a simple SQL: select orders_id,keycode,validpayment,moneyreceived,prospect_id from orders where Keycode='ABCDEF123' and validpayment='valid' and moneyreceived>0 and prospect_id is NULL option (maxdop 1) If I run with option (maxdop 1), it returns correct lines. But if I run ...
Score I'm confused need some help ... with Union
riaz.hasani - 30 Jun 2005 5:31 PM - 5 messages
Hi every1, I trying to get data using a UNION ( so I can have all the values, because in the main table in one column 'PARENT_PROD_ID' the value is missing for one particular record). However, it is repeating the rows for that particular record where the ...
Score Transaction not commited rolled back?
Larry - 30 Jun 2005 5:07 PM - 2 messages
In VB 6, using ADO, SQL Server 2000 In my VB program I use the connection object (abc) to begin a transaction. abc.BeginTrans I then, in my VB App, using ADO, execute multiple stored procedures inserting records into temp tables ##Meetings, ...
Score I can delete a backup... but how to delete the logs in EM?
Star - 30 Jun 2005 4:55 PM - 4 messages
Hi, I have been able to delete a backup just using this: exec master..xp_cmdshell 'DEL e:\databases\MYBACKUP.bak' However, If I go to EM and I click on 'Restore Database' I still can see that backup listed there. Is there anyway to update those logs? ...
Score Formatting in the SELECT statement help needed.
SteveInBeloit - 30 Jun 2005 4:52 PM - 4 messages
Hi, I am trying to replicate this statement in a SELECT: IIf(IsNull([cmZip4]),[cityst] & "  " & [cmZip],[cityst] & "  " & [cmZip] & "-" & [cmZip4]) AS CityStZip If cmZip4 is null, I want to format cityst + " " + cmzip, if it is not null, ...
Score Is there a way to repress DBCC row counts?
BDB - 30 Jun 2005 4:42 PM - 4 messages
Hi, I'm using DBCC like this: SET NOCOUNT ON DBCC ... WITH NO_INFOMSGS And I still get a row count.  How to I repress the row count? Thanks, Bryan ...
Score Number of records deleted
mlwallin - 30 Jun 2005 4:32 PM - 4 messages
I have a stored procedure initiated by the user that determines records to purge, then does a delete query.  I want the stored procedure to give some feedback by returning the number of records that were deleted.  How do I do ...
Score Query urgent
Roy - 30 Jun 2005 4:16 PM - 4 messages
Hi all, I need to identify duplicate data (based on the non-key columns) in two tables that have a child parent relationship: Table1(ColID, col1, col2, col3, col4) Table2(CID, colID, c1, c2, c3) These are columns that could have same data: Table1(col2, col3, col4) and ...
Score View Explaination
Job - 30 Jun 2005 3:55 PM - 12 messages
Let me see if I have this straight; A view is like a virtual table.  Once a view is created, I can update and manipulate the view and it will always maintain those changes, yet not change the tables that the views are based upon. So, why use a view instead ...
Score Odd Count results
Jeffrey K. Ericson - 30 Jun 2005 3:28 PM - 6 messages
The following queries; select count(id),year(transactiondatetime),month(transactiondatetime),day(transactiondatetime) from tblMasterRT where transactiondatetime>'5/1/2005' and transactiontype in ('a','r','l','o','j') and transactioncomplete=1 and flag3=1 group by year(transactiondatetime),month(transactiondatetime),day(transactiondatetime) ...
Score Index Question
Kathy - 30 Jun 2005 3:27 PM - 9 messages
Hi All again I have a question on an index The query is as follows SELECT  * FROM dbo.IP_Addr_Work AS iaw LEFT JOIN dbo.IP_Address_City_Lkp AS iacl   ON iaw.IPAddress BETWEEN iacl.IP_Address_From AND iacl.IP_Address_To What index is more efficient ...
Score Warning: Null value is eliminated (causing sproc to fail)
Steve'o - 30 Jun 2005 3:09 PM - 11 messages
Server  = SQL Server 2000 SP3a Client = Access 2000 SP3 My sproc works fine if I run it piece by piece, the sproc fails when called by iteself. It stops at a particular point with: [Warning: Null value is eliminated by an aggregate or other SET operation] ...
Score SQL-DMO
John Barr - 30 Jun 2005 3:01 PM - 4 messages
Can anyone tell me where to find an object map of the SQL DMO libraries? I am looking for something that shows the objects and all their properties kind of like the SQL Server system tables help file Microsoft provides. ...
Score Possible bug in T-Sql or Odbc Driver? Date time conversion to int...
certolnut - 30 Jun 2005 2:57 PM - 5 messages
Hi All I have a code block which works and looks like this... SELECT      i.ItemNumber   , i.ItemDescription   ,h.[Year]   ,d.OnHandQuantity   ,h.IssuedQuantity1 + h.ShippedQuantity1 as January FROM         dbo.FS_Item i INNER JOIN ...
Score question about index
Britney - 30 Jun 2005 2:48 PM - 2 messages
Hi guys,       When I try to generate a table script including index and primary key, I want to apply this table script to another sql server. but I got the following script return, do I really need this code? ...
Score Finding mismatched debit and credit columns in a large transaction
Cynthia - 30 Jun 2005 2:37 PM - 6 messages
Hi, There is a requirement to find mismatched transactions for credit and debit columns. The table is 29 Million rows.  The case statement takes the current amount in the credit column and finds the value in the debit column, ...
Score Questions about the uniqidentifier
Arjen - 30 Jun 2005 2:30 PM - 5 messages
Hi, I'm using the newId() function inside CREATE statements for a new unique value. - Do I need to set the "Is identity" property to "yes"? - What's happen when the newId() function creates a value that already exists? Or is this impossible? ...
Score Delete existing backups
Star - 30 Jun 2005 2:16 PM - 3 messages
Hi all, I have the file MYBACKUPS.BAK that contains several backups 001-Back1 (Complete) 002-Back2 (Complete) 003-Back3 (Complete) (They are always Complete) How can I delete from Query Analyzer '002-Back2'? I haven't been able to find how to do that... ...
Score Lock
Ed - 30 Jun 2005 2:16 PM - 3 messages
Hi,   Does anyone have any samples about what I need to capture in SQL Profile in order to look at the Lock/DeadLock situation? Thanks Ed ...
Score IP Address - Urgent
Kathy - 30 Jun 2005 2:15 PM - 6 messages
Hi All, I need to know how to do the following I need to know how to validate an IP address i.e. if you have an ip of 10.1 (not valid) if you have ip of 10.1.1.1 (then valid) ...
Score Compare values of records in same table
Chesster - 30 Jun 2005 2:05 PM - 4 messages
CREATE TABLE test (material varchar(3), import_dt smalldatetime, qty int) INSERT INTO test values('aaa','6/5/2005',0) INSERT INTO test values('aaa','6/16/2005',75) INSERT INTO test values('aaa','6/20/2005',159) INSERT INTO test values('bbb','6/8/2005',7) ...
Score Linked Server
Luis Oliveira - 30 Jun 2005 1:45 PM - 3 messages
Hi, anyone knows how to verify if a linked server is active only using SQL code? This question is because I need to check if a created linked server is ok to perform actions on it. Many thanks,     Luis ...
Score Finding non distinct rows in table
Sam - 30 Jun 2005 1:39 PM - 3 messages
I am trying to find non distinct rows in a table.  For e.g 1.A list of all same Social Security numbers 2.A list of all same last names Could someone please assist with what is the sql for this. ...
Score Import Comma delimited text
Rick - 30 Jun 2005 1:27 PM - 3 messages
I need to create a stored procedure to import a comma delimited text file into a SQL table.  I am new to SQL, am very compfortable with VB and Access.  Anyone have a good reference for me to look at? A good source of info for me ...
Score Problems with NOT IN
Joey Martin - 30 Jun 2005 1:01 PM - 8 messages
I am trying to perform a basic NOT in query using Query Analyzer in SQL 2000. I get no results, and I know they are there. select createdate,* from riccustomers where email  not in (select email from ricorders)  order by custno desc ...
Score Nested Set model in SQL
kongsballa - 30 Jun 2005 12:57 PM - 2 messages
Hi! I just bought the book "SQL for smarties" by Joe Celko. Here he shows the possibility to use the nested set model. I am in the situation where I need to model a hierarci: One company has several regions that has ...
Score Querying a table in any database
Shrikant Patil - 30 Jun 2005 11:48 AM - 3 messages
Hi gurus, I am trying to create a stored proc, which accepts a database name as parameter. This is then supposed to query a table on a field (db_version.current_version) in "that database", and check if the value in that field is = '1.0.1.1' ...
Score Foreign key and nulls
Ronald Green - 30 Jun 2005 11:05 AM - 5 messages
Hi! If I have a field in a table, that has a foreign key but also allows nulls, would it affect my queries, performance or data size in some way? Specifically, if most values in the field are nulls? My other option is to create a junction table between the two tables ...
Score Upgrade from SQL Server 7.0 to SQL Server 2000
Poorna - 30 Jun 2005 10:19 AM - 7 messages
Hi, I am faced with an unusual SQL Server upgrade related problem.I was using the SQL Server 7.0 until about a few days ago when we upgraded to SQL Server 2000. I had the following query in one of the views. ...
Score Design Issue - generating shifts from dates
Chris Strug - 30 Jun 2005 9:17 AM - 4 messages
Hi, Earlier in the week David Portas (thanks again by the way) was kind enough to provide a few pointers with regards to a problem I was having creating shifts from a date. In overview I have a calendar table with around 10 years worth of shift ...
Score return multi recordset error?
rouqiu - 30 Jun 2005 9:03 AM - 5 messages
Hello, I have a stored procedure that returns two tables. It works fine in the query analyser. However, When I write a vb 6 application and ADO 2.5 to get the two recordsets, it always give me recordCount -1, EOF or BOF results. If ...
Score Create week Dates Intervals View
romy - 30 Jun 2005 8:41 AM - 3 messages
Hi I need to create a view which displays all WeekDates from sunday to saturday in a certain year. The view stucture should be something like: Year, date(sunday), date(saturday) Example: 2005,  5.6.05, 11.6.05 ...
Score Order By CASE with different datatypes possible ?
hals_left - 30 Jun 2005 8:35 AM - 5 messages
This query allows a specific row to returned first, if found. Is it possible to modify so that results are ordered by Title (varchar). When I try this I get data type conversion error. thanks. hals_left Create procedure dbo.getResults ...
Next »