Archived Months
January 2003
March 2003
April 2003
May 2003
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
April 2008


all groups > sql server programming > february 2005 > threads for wednesday february 2

Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

Data from three Tables (Joins)
Posted by agarwalp NO[at]SPAM eeism.com at 2/2/2005 11:52:26 PM
Thanks for your responses. Well the time can be same and cannot be same For ex: Table1 (timestamp,readingA) (2/2/2005 12:09:26,123) (2/2/2005 12:19:26,324) Table2 (timestamp,readingB) (2/2/2005 12:09:26,321) (2/2/2005 12:29:26,657) Table3 (timestamp,readingC) (2/2/2005 12:09:26,...more >>

flat file to raletionship database
Posted by souris at 2/2/2005 11:05:14 PM
I have an app which needs to download from mainframe flat file to my relationship database (Parent - Child) tables. I would like to know are there any better solution. My flat file data structure like following: Filed Name Account Number : Char(10) Account Name: Char(35) Address1...more >>

HOST_NAME length
Posted by Gary K at 2/2/2005 10:25:05 PM
Sorry 2 bug, but I would like to know how long a variable should be to handle the maximum HOST_NAME length? All the documentation tells you is the datatype (nchar) and if you use this datatype you get a default length (usually 1)....more >>

Multiple Stored Procedure Execute Together - How?
Posted by GJ at 2/2/2005 10:13:01 PM
Hi, I have multiple stored procedures (SP) running in multiple databases. The output of all the databases has same column names, same number of columns and column types. I want to run all these different SP's as one SP and combine the output as one result. I tried creating one new S...more >>

Date Help
Posted by tina via SQLMonster.com at 2/2/2005 9:53:41 PM
I have a table that contains 5342 records where it is titled: effbegdat. The table information is 12/30/1899 08:00:00 The date information is all the same, but times are different. I am attempting to only alter the date. Or update the dates and leave the times as they are set in the table. Th...more >>

Newb query on query :)
Posted by Manny at 2/2/2005 9:21:02 PM
Hi, Newb question here, I have two tables (A & B) that I want to join and exclude the elements that match, what would be the best aproach for this? thanks in advance. (BTW I'm comparing 5 fields that have to match from each table: A1 = B1 And A2 = B2 .... and so forth.) ...more >>

stored procedure question
Posted by DaveF at 2/2/2005 8:21:47 PM
I pass a stored procedure 2 strings: '1,11,21' StringVal and '1,2,3' StringVal1 need to loop threw the values and update the table? This is what I am trying, but it is looking for StringVal to be an INT ALTER PROCEDURE dbo.updateVotes ( @StringVal nvarchar (50), @StringVal1...more >>

Not sure which group to post in.... I have a problem with dates
Posted by sh0t2bts at 2/2/2005 8:16:02 PM
Hi All, I am trying to pull data into an SQL 2000 Server from an Informix server I can do "select * from My_table where row_date = '12262004'" This works fine.. But I am trying to schedule this as a local package and have the date use the system date I have tried changing the date to "...more >>



Brain cramp
Posted by John Baima at 2/2/2005 8:01:03 PM
Okay, I'm having a brain cramp. This query should not be too difficult, but I'm having a hard time concentrating. I have 2 tables (well, a lot more than that, but I don't care about them right now). A Tech table and a workorder table. I need to produce a single result with all the tech ids and...more >>

Update Statement Help
Posted by Lontae Jones at 2/2/2005 7:09:02 PM
My Update is not working what can I do? I get this error. Update Agent Set Passwd = 'Mercury1' where Name like '%admn%'or Name like '%admin%'or Name like '%prin%' error I get Server: Msg 512, Level 16, State 1, Procedure Updatetrigger1, Line 15 Subquery returned more than 1 value. This ...more >>

import mysql dump file in sql server
Posted by M. Posseth at 2/2/2005 7:08:54 PM
does anyone have a good idea how i can easily import a mysql dump file in a sql server 2000 enterprise edition The dump file is 7 gig big however my MS SQL server is a DELL poweredge 4600 with 2 x 2.8 GHZ hyperthreaded XEON processors 800 gig harddisk space and 6 gig of memory ( running o...more >>

header file for master..sysmessage
Posted by Ajey at 2/2/2005 6:59:22 PM
hi, Is there a header file available for error codes in master..sysmessage. Thanks. - Ajey ...more >>

Restore at the point of failure
Posted by sql fren at 2/2/2005 5:59:02 PM
I m doing a test restore from my live to test db( to test restore at the point of failure) Below is my script : -- Back up the currently active transaction log of Live DB BACKUP LOG LIVEDB TO disk = 'C:\Log2.TRN' WITH NO_TRUNCATE GO -- Restore the database full backup from Live DB t...more >>

UPDATE one-one-relation
Posted by Bert at 2/2/2005 5:55:04 PM
Hi, I've got two tables that have a one-to-one relationship (on the single-field PK). In Table1 are 8 fields that have to be synchronized to Table2. What's the best way to do that? I should think of something like: UPDATE Table2 SET Field1 = ..., Field2 = ... but in the update-statem...more >>

diff. between simple and full recovery
Posted by BCat at 2/2/2005 5:54:36 PM
Hi all, do anyone know what is the different between simple and full recovery mode in database properties. thanks ...more >>

How to get stored procedure to ignore an @@error.
Posted by Vern at 2/2/2005 5:27:03 PM
I'm trying to pass back to the calling program, the value of @@error from a stored procedure. The stored procedure seems to work properly, but the calling program diverts program flow to the "catch" portion of the try/catch section since it knows an error occured. I'd like for it to just cont...more >>

Get a list of files a SQL Server instance can access
Posted by Graham Morris at 2/2/2005 5:23:39 PM
I'd like to be able to present my user with a tree view of the devices and directories a remote SQL Server machine can access. What I need to do is what Enterprise Manager can do: if I connect to a SQL Server database on a remote machine to do a backup, when I come to select a filename the...more >>

Count number of visitor
Posted by Mustapha Amrani at 2/2/2005 5:20:36 PM
I have a database of visitors as follows: Name; Begdate, Enddate I would like to count the number of visitors every day over a six month period. Is there an easy way to do this using SQL? ...more >>

Help with Join
Posted by ajmister at 2/2/2005 5:17:59 PM
H I have two tables Create table company ( firm char(32), p_name char(40), proj_code char(8), proj_start_dt datetime ) go insert into company values ("ABC","John Doe", "DJOE","Nov 12 2001"...more >>

LAST FUNCTION
Posted by Ray Medina at 2/2/2005 4:41:47 PM
I have a sql database that I am trying to make this query work. The problem is that I can't get the right info out, right?? So, I exported two tables to an Access database, and this is my query that works beautifully.. Question is, I don't want to keep exporting this info everytime, I want ...more >>

linked server suddenly doesn't work!!!
Posted by R. van Laake at 2/2/2005 4:27:51 PM
Hi, I have an ASP page working with a database DBNL. There also is a linked server named OFFICE. Until an hour ago all worked fine; I could get data with a statement like "select name from office.custdata.dbo.customers". Suddenly, without **ANY** changes at all to either server it stopped w...more >>

how to write sql to use Profiler to capture sql and sp running longer than 5 sec
Posted by Mullin Yu at 2/2/2005 4:16:43 PM
hi, i have two db, say db1 and db2. i want to create a sql statement to capture those sql statement and sp running longer than 5 sec. any hints? i don't want to use Profiler. thanks! ...more >>

Newbie- help with UNION clause
Posted by Coffee guy at 2/2/2005 4:15:02 PM
I have a parent table for whom there are repeating children plus occasional oddball children. Rather than create massive child table with the same item over and over for each parent, I am trying to build a parent to 2 children relationship like this Parent ID Name FKID 1 A ...more >>

error while inserting data in to sql thru procedure
Posted by Lal at 2/2/2005 4:11:15 PM
Dear all, I am using the procedure for inserting data in to my tables. when i try to inserting large lenght data the follwing error is comming "Server: Msg 103, Level 15, State 7, Line 1 The identifier that starts with '7,'ppppppdd','asdf','asdf',1, 1,1,'asdf','sadf','asd','asdf','asdf','as...more >>

Convert Time?
Posted by buc at 2/2/2005 2:55:08 PM
How can I get the current time in 12H format? I tried convert(nvarchar,GetDate(),108) changing the 108 to other things but I cant seem to find the right one. Changing Regional Options in control panel had no affect.. Thnaks BUC ...more >>

server port number
Posted by JJ Wang at 2/2/2005 2:54:31 PM
hi guys, how can you determine/find out the port number of your sql server instance on a sql 2000 server? I can figure out how to set the port number in 'client network utility', but can't figure out how to view it. many thanks. JJ...more >>

how copy table
Posted by f1414 NO[at]SPAM mail.ru at 2/2/2005 2:34:08 PM
How I make sql queries for coping one table (exist) to another table (no exist)...more >>

size of NTEXT Field
Posted by CB at 2/2/2005 2:25:47 PM
Hi I have a table that has a field defined as NTEXT. I need to get an average size of the field. Does anyone know how this can be done? Thanks in advance Craig ...more >>

Metadata Inheritance
Posted by Paul at 2/2/2005 2:03:45 PM
Hello, I have written a mechanism which returns meta data back to a client for different views. For example, one meta data item on a column is the Display Name. Now, so I don't have to keep attaching meta data to a particular column every time I create a new view, I "inherit" the meta d...more >>

URGENT: Supporting different DBMS.
Posted by Sami at 2/2/2005 1:42:14 PM
Hello, I would like to enable several DBMS support for my application. Is there any website or book that covers the topic of what to consider when incorporating multipledatabase support for an application. The databases that I am looking to support are MSSQL Server, Oracle, Gupta SQLBase, MyS...more >>

Backing up SQL Server: VDI or SQLDMO?
Posted by jpstewart at 2/2/2005 1:41:02 PM
I am in the process of writing a backup software package, and I posted a question here a while ago about how to best backup SQL Server databases, and the preferred approach for implementing backup from a program written in C++. Louis Davidson recommended SQLDMO, but since then I've found docu...more >>

VB App and SQL Server
Posted by Emma at 2/2/2005 1:17:05 PM
When installing a VB application that connects to SQL server, do I have to install the SQL connectivity client as well? I am trying to run an application on a workstation without the connectivity client and I get the following error message: [Microsoft][ODBC SQL Server Driver]Client unable to ...more >>

Inserting document into SQL Server
Posted by Drew at 2/2/2005 1:12:29 PM
I am trying to setup a document management system for the policies and procedures here at my work. I have never worked with binary data in a database before. The goal is to allow full text searching of the documents. All the documents are in Word format. Can this be done? Is this a good wa...more >>

smalldatetime formula for sql server?
Posted by roy.anderson NO[at]SPAM gmail.com at 2/2/2005 1:06:08 PM
Hey all, I'm trying to implement a simple solution here... In a sql server table I have a smalldatetime field. If one goes into the table Design view and clicks on the smalldatetime field there is a "Formula" area wherein one can presumably enter in some code and whatnot. What I wish to do ...more >>

String concatenation in a HAVING Clause
Posted by Nathan Howard at 2/2/2005 12:53:03 PM
I trying to add searching of a users name to a query using the following code segment: HAVING (Users.u_FirstName + ' ' + Users.u_LastName) LIKE @SearchText This returns nothing. However this HAVING Users.u_FirstName LIKE @SearchText works fine. I would like to search both the first na...more >>

SQL question: How to periodically read the last 'n' rows of a simple table?
Posted by Hamelech Al Hakol at 2/2/2005 12:16:27 PM
Hi I have a simple table that grows over time. I want to monitor the size of the table and retrieve *only* the rows that were added since I last accessed the table (this is analogous to the 'tail -f' command in Unix/Linux). I woud like to do something like select * from tableNam...more >>

Please help with sorting?
Posted by Brett at 2/2/2005 12:13:31 PM
The following query will work when the groupid (third column) has two or more entries. You can see that groupid for 40 and 41 (rows 8 and 9) only have one entry each, as opposed to groupid 1 and 9 (first four rows), which have two entries each. Group 1 has two entries: 20366 -2147428943 1 ...more >>

Sending a message from a trigger
Posted by Gabi at 2/2/2005 12:09:05 PM
Hi! Is it possible to send a message to a user when a certain condition becomes true in a trigger on a table? I have a SQL Server 2000 back end and a VB6 front end and I would like the user to be notified (through a message box) when a field in a table has a specific value. Right now I have...more >>

Querying Distributed Partitioned Views after concatenation leads to unindexed temporary table?
Posted by Ian Boyd at 2/2/2005 11:47:08 AM
Imagine type hypothetical DDL against different servers: Remote Server: CREATE TABLE Customers ( CustomerID int, Name varchar(50), IsActive bit, SomeCode char(1) ) Local Server: CREATE TABLE Customers_BZ ( CustomerID int Name varchar(50), IsActive bit, ...more >>

beginner: long running sp
Posted by Mullin Yu at 2/2/2005 11:41:11 AM
hi, i have a sp that takes around 5-6 sec even though there're around ONLY 5000, therefore, i need to tune it. any ideas for me to do so? thanks a lot! PS. Table ==== OutboundQueue [JobID, .....] JobID - P.K OutboundQueueItem [JobItemID, JobID, ......] JobItemID - P.K and JobID ...more >>

Cannot update the table in SQL Analyzer
Posted by Agnes at 2/2/2005 11:32:58 AM
I want to update the table se.g update myTable set t1=0,t2= 0 However, i got the following error Could not allocate space for object '(SYSTEM table id: -631615181)' in database 'TEMPDB' because the 'DEFAULT' filegroup is full. ...more >>

View Name
Posted by siaj at 2/2/2005 11:05:03 AM
Hi , I stumbled today at a strange today... I have a view named V_RelayConfigRoutingRules_GroupName. When I generate a create script for the view using eneterprise manager or through the object browser of Query Analyzer it generates a script as CREATE view view_GroupName AS ..... ...more >>

Common error codes for ADO & DMO
Posted by Ajey at 2/2/2005 10:39:01 AM
hi, The error codes I am getting for errors like SQL server not available, invalid sql credentials, login not a database user etc. are not same for ADO & DMO. Is there a way to get common error codes for ADO & DMO? Thanks. - Ajey ...more >>

Evaluation Concept
Posted by Ed at 2/2/2005 10:21:03 AM
Hi, For SQL like the following Update BusinessOperation Set ActualAmount = @AssetPercentage * A.AssetAmount From BusinessOperation B Inner Join @Asset A on B.[Month] = A.ReportMonth and B.[Year] = A.ReportYear and B.CostCenter = A.CostCenter where B.[Month] = @Month and B.[Year] = @Year ...more >>

help with query
Posted by Dave at 2/2/2005 10:15:56 AM
Hi folks, I'm fairly new to the SQL arena and need a hand wrapping my mind around something. First allow me to paint you a picture: I'm developing an ASP page (not .net) for inventory management. At the moment I have 2 tables. 1) ProductTable has the following columns: ID, Part, Descr...more >>

Log files
Posted by PH at 2/2/2005 10:11:24 AM
I am getting the error message , "Could not allocate space for object '(SYSTEM table id: -1021390423)' in database 'TEMPDB' because the 'DEFAULT' filegroup is full." when i run a select stmt. I am thinking it's because my log file is full. Can you pls tell me what i am supposed to do now?...more >>

Extracting words from strings
Posted by Damien at 2/2/2005 10:01:04 AM
I've done up this script which I'll turn into a user-defined function for extracting words from text. However it seems a little over-complicated. Anyone got any ideas of how to simplify it? Thanks Damien SET NOCOUNT ON DECLARE @word TINYINT DECLARE @search_strin...more >>

Time-zones difference affecting data in reports
Posted by cnpatel NO[at]SPAM softhome.net at 2/2/2005 10:00:45 AM
Hi, we are running a 3rd party s/w for customer support and support engineers are located in UK, France , US etc.... An engineer in US can answer European customers query. Support engineers are using clients to connect to main db server located in UK. the problem with that is when they ...more >>

Full-Text Indexing...
Posted by Brett Davis at 2/2/2005 9:59:35 AM
Hello, I have one question in two parts: Part 1: If I am doing a full population of my catalog... will the search capability be "broken" (by this I mean I am unable to return results from my queries) until my full population is completed? Part 2: ...more >>

Query to get the last inserted records first
Posted by Olivier Matrot at 2/2/2005 9:42:57 AM
Hello, I have a table where new rows are inserted on a regulary basis (one by one) during the day. Several thousands of new rows are inserted every day. This is an 'History Like' table. It contains a DateRecord column. The table is queried so that last inserted records must appears first in th...more >>

Comparing Nulls
Posted by jaylou at 2/2/2005 9:05:17 AM
Hi All, I am in the middle of checking data between SQL servers. I am not getting any rows returned because in one server the amount is null in the other is is a number. why aren't these unequal amounts coming in? I have the same issue with date fileds. my code is: select a.accountkey,b.ac...more >>

Raiserror logging in Application Log
Posted by Satish Balusa at 2/2/2005 8:56:12 AM
I am using a custom error message with the following syntax, where I have ommitted the "WITH LOG" clause. RAISERROR(60002, 16, 1, 99999, 'TestForLog', 'Test Table Name', 'Test Message to Log') WITH SETERROR With the above syntax, the error is still getting logged to the application log (eve...more >>

String comparison inline query
Posted by DL NO[at]SPAM AXA at 2/2/2005 8:15:01 AM
Hi! I need to compare names in two different tables. Problem is, in one table a name might be listed as John Smith and in the other table it could be John Smith Jr. I need these to match up somehow. I've tried using a LIKE comparison but seems that only works when the comparison string is sta...more >>

Table permissions
Posted by Eric D. at 2/2/2005 8:09:04 AM
Hi, I'm trying to display permissions to a specific table for a particular individual. How would I go about doing so. I'm pretty sure it has to do with information_schema, but that's as far as I can go. TIA...more >>

Converting money to negative value
Posted by ChrisB at 2/2/2005 8:07:05 AM
I need to find away to convert a significant amount of data to be negative money values. ie April value = 155.66 needs to be -155.66 if certain other fields meet a specific criteria. Is there a simple way to convert money data values to negative....more >>

arrays
Posted by Preeta at 2/2/2005 7:55:08 AM
Thanks! I am aware that you can't pass an array to an sp. i was aware of that even when i asked that question. I simply did so, because I needed to prove this to somebody. "louise raisbeck" wrote: > this post was a few days ago so no idea if you will all read this but just > read this po...more >>

Easy about Varchars
Posted by crever at 2/2/2005 7:37:07 AM
I've done some testing recently to find out exactly how much overhead varchars have. I have found that it seems to vary. When compared to the exact same char, it seems to have a varied difference. If I create a table with char(1), and another with varchar(1), and populate them both with lik...more >>

script to add users
Posted by Sammy at 2/2/2005 7:37:01 AM
Hi I have to add a lot of users to sql server with datareader access I have created the script below but this does not work do you know what I would have to cahnge to get it working? thanks for any help Sammy DECLARE @user varchar (8) DECLARE @SQLString NVARCHAR(500) DECLARE @pwd NV...more >>

random split
Posted by aamirghanchi NO[at]SPAM yahoo.com at 2/2/2005 7:20:02 AM
Hi, what will be the easiest way to randomly change a column value into other values based on a percentage split. For e.g. changing all the integer "1" in a column into integer 2 and 3 such that 2s are 80% of the original 1 and the remaining 20% are 3s. I hope I was able to explain it? TI...more >>

Query Tuning -- Where Exists?
Posted by C TO at 2/2/2005 7:11:04 AM
Hello World! The following query takes more than one hour to complete. Assuming the tables are properly indexed, if this can be tuned for quicker return? Besides, I wonder if WHERE EXISTS is always/usually more efficient than INNER JOIN? Can WHERE EXISTS be implemented in this case and how...more >>

Date_Time Convert(24) to DateTime Format
Posted by Joe K. at 2/2/2005 7:11:01 AM
Please help me modify the sql statement so that I average weekly values for FullScan and CPU. My Date_Time and samples are written to a table with the char(24) format. I need to convert the Date_Time field from char(24) to datetime format. Please help me with this task. Thanks, Dat...more >>

Dates
Posted by Peter Newman at 2/2/2005 6:17:07 AM
what is the easiest way of getting the 1st and last date of any given month?...more >>

Search for different values in one field
Posted by milmus tender at 2/2/2005 5:35:04 AM
Hi, i´m searching of the best way to do following: I have in my application a textbox for the conditions to search. Each blank should be replaced with an "and" in the condition. example: text in the textbox: "FirstValue SecondValue ThirdValue" SQL-Statement: ....WHERE myField = 'F...more >>

Drop Table
Posted by Reg Coles at 2/2/2005 5:05:02 AM
Created a database which is going to import data from a Oracle database every week automatically. I need to know is there a way I can either get the import to override the existing data or a script to 'drop table' before importing. I've done a test on importing the data and it just adds concurr...more >>

How to get last lsn for my DB
Posted by checcouno at 2/2/2005 4:03:04 AM
I need to restore multiple set file from a transaction log backup. To know from which position of this file starting my restore, i need to know the last lsn point restored on my DB. while @id_start < @id_stop begin set @id_start = @id_start + 1 RESTORE LOG [MYDB] FROM DISK =...more >>

Help needed on sum query
Posted by Peter Newman at 2/2/2005 3:13:03 AM
i have two table, one containing banking files header (a) information and a second table containing the banking transactions (b) they are linked by a LedgerKey field The banking transaction my have a trans code of either 99 0r 17. Im trying to get the sum of the header files where transact...more >>

Data from three Tables (Joins)
Posted by agarwalp NO[at]SPAM eeism.com at 2/2/2005 2:35:59 AM
I have 3 tables. Table1(time,readingA) Table2(time,readingB) table3(time,readingC) Now the time can be same and it can be different. Now i want to know how do i join so that i get the data: time,readingA,readingB,readingC If the time is same then it is fine, but if the time is not same in tw...more >>

add user to role with WMI
Posted by Marc at 2/2/2005 1:57:01 AM
How to add a win32 user defined in the sql server to a User defined role with WMI for sql server Guess MSSQL_MemberUser would do the trick, but how ? Can someone post a quick example Mydomain\User1 as username My_Role_Read as role name Win srv 2003 standard Sql srv 2000 standard wi...more >>


DevelopmentNow Blog