Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score best way to get percentages
rodchar - 15 Jul 2006 7:54 PM - 10 messages
hey all, this may look familiar to some of you but i have a new question regarding this: i have a small table that looks like the following: gender/age ------------- male     18 female  32 male     40 ...
Score Is it acceptable to...
Daniel - 15 Jul 2006 5:56 PM - 13 messages
.....store some data in a logfile and a reference to the logfile location in the database? For instance i have a situation where any number of players could be playing a game. I can do this: GameTbl GameId GameName linked to a table: ...
Score LEFT OUTER JOIN
intractably - 15 Jul 2006 4:57 PM - 12 messages
What is a left outer join? If you don't know what a LEFT OUTER JOIN does in SQL, look into it in the docs. This will eliminate the need to perform many queries outside of SQL. It performs a "non-restrictive" join across multiple tables. In ...
Score Transactions in PHP on SQL Server 2005
~john - 15 Jul 2006 3:40 PM - 9 messages
I'm trying to get a transaction to work with PHP 5.1.4 and SQL Server 2005... The first SQL statement deletes several rows in the database. The next SQL statement loops through and inserts several rows into the ...
Score MSSQLSERVER I/O error (bad page ID) detected
erolozgunay - 15 Jul 2006 2:39 PM - 2 messages
have ms sqlserver 2000 istalled on windows 2003 standart edition server when i try to use my program program give error  and then close in the event viewer MSSQLSERVER Error: 823, Severity: 24, State: 2 I/O error (bad page ID) detected during read at offset 0x00000000a1c000 ...
Score Why VC++ ADO runs slow on WIN2003 cluster ?
ikaliy - 15 Jul 2006 12:05 PM - 7 messages
Hello, I have a performance problem with component written in: - VC++ 6.0 as console application which uses - ADO for connecting to SQLServer2000 for - exporting data from one table into ASCII file. Component works fine on my laptop (WinXP,1GB RAM). ...
Score Best site for java and programmer
omar.abid2006 - 15 Jul 2006 9:20 AM - 1 message
[link] interactive site for java , mobile , wap and web . a very helpful team also for all your question and problem for any programming language ...
Score stored procedure execution
nithya - 15 Jul 2006 7:01 AM - 4 messages
We have upgraded our operating system of database server to win 2003 standard edition. We could install the sql server-2000 properly. All workstations are still win-NT and established the connectivity also. But when we tried to execute the stored procedures it shows error as follow. ...
Score sql query copy database
Howard - 15 Jul 2006 5:03 AM - 2 messages
I have two databases, both have a table with the exact same structure. i would like to merge the two databases, copy TABLE from database2 to TABLE database1 where ID column in database2 > 400 thanks Howard ...
Score VS 2005 Standard Edition
Joe Delphi - 15 Jul 2006 4:39 AM - 2 messages
Hi,       I want to debug a stored procedure.  I am using Visual Studio 2005 Standard Edition and SQL Server 2005 Express.   I open the stored procedure but it will not let me set a breakpoint.  I can see menu items with terms ...
Score turn table sideways...
rodchar - 15 Jul 2006 3:31 AM - 7 messages
hey all, i have a small table that looks like the following: gender/age ------------- male     18 female  32 male     40 female  25 female  26 female  30 how can i store or display horizontally like the following: ...
Score querying multiple tables
chentiangemalc - 15 Jul 2006 3:00 AM - 4 messages
Hi, I'm wondering if anyone can offer some advice in how to write a query for this type of instance: The data I am looking at is in a table with columns as follows: dbo.data: id, time, value, quality ...
Score Triggers
Brent Stevenson - 15 Jul 2006 12:59 AM - 5 messages
I need a method to initiate an external process (a Business Objecs report) once a SQL table is updated. Do triggers provide a means to perform this? If not is there anything else SQL related that does? ...
Score illegal characters
JTL - 14 Jul 2006 11:42 PM - 4 messages
is there a function in sql server that will check a string for illegal characters?  i have a column that sometimes contains values like: ? ???¦++++S+n¦÷+¦ú¼-·+½+-+-¦p++¦÷¦÷¦-ú+ú¼-¦°-«¦+¦«¦-+¡--+++Ñúí+¦ ...
Score Managing Multiple Servers
Brian Shannon - 14 Jul 2006 10:35 PM - 2 messages
I am using sql server 2000 at 3 seperate properties.  Each property is treated as it's own but many times I am required to perform a combined analysis.  I am not a DBA nor do we have a DBA but I am fairly knowledgable ...
Score subquery inside select to concatenate results ?
mdscorp - 14 Jul 2006 9:50 PM - 5 messages
this code works fine DECLARE @st varchar(100) SELECT @st=@st+service.status FROM service WHERE service.id=@ID SELECT @st will display all data in the status field just concatenated Now, i wonder if i can do this SELECT a,b,c,(SELECT @st=@st+service.status FROM service WHERE ...
Score SQL Query help
Don Khan - 14 Jul 2006 9:46 PM - 2 messages
Hello, I'm having a bit of problems getting the following done in sqlserver 2000; I have a table with the following fields: ClientID | FileName          | Revision | LocalPath =================================================== 27       | C:\xxx\layout.xml | 2        | C:\filepath1 ...
Score CREATE TABLE Defaults have double passwords
Dr. Network - 14 Jul 2006 8:43 PM - 2 messages
SQL 2005, Service Pack 1 using SSMS: I'm creating a table with default values for the columns. When I create the table, there are no parentheses around the default values. Then when I script out the table using SSMS, the default values have a double set of parentheses around them. Further, the values in SYS.SYSCOMMENTS for the columns have the double parentheses. I deliberately mixed up the order of the defaults in the creation script hoping to see if this made any difference. Here are the scripts: ...
Score master table and child table andfield concatenation and loop records ?
mdscorp - 14 Jul 2006 8:39 PM - 18 messages
i have a main table as in: tbl_main with field a,b,c,d,e I have a child table as in tbl_child with fields a,b,c,d I must go through tbl_main , then for each tbl_main record I must also ...
Score How to get the record created date?
tcw - 14 Jul 2006 8:15 PM - 10 messages
How do I delete rows that are older than 180 days if the table does not contain a column of timestamp? The following statement works fine if parameter startdate is known:     DELETE From MyTable Where DATEDIFF (day, startdate, GETDATE()) > 180 ...
Score Returning records updated
David - 14 Jul 2006 7:31 PM - 2 messages
I want to return the # of records updated and I was thinking of using the following SP.  Will this work on SQL 2000 or 2005?  Thanks CREATE PROCEDURE [ms_updROProblemCount] (@RecordID  [int]   @Processed [int] output) AS UPDATE [Marshall].[dbo].[RepairOrder] ...
Score Red-Gate Log Explorer
Jason_Williams - 14 Jul 2006 7:16 PM - 2 messages
Does anyone happen to know if the folks at Red-Gate used a public SDK to create the log explorer, or did they fork over money to microsoft to get a ISV licensed SDK? I'm looking into making a similar product that would be open source, ...
Score update all columns if exists, or do the insert based on pk
trame2006 - 14 Jul 2006 7:02 PM - 11 messages
I have base table and temp table with new data. I need to update changed columns of the base table , if pk exists or do the insert.  Any examples for doing this? The table is having more than 50 columns, I ...
Score Column permission being ignored by Access Form Combo box
kellysc - 14 Jul 2006 6:51 PM - 4 messages
I have a table linked to an access mdb which I have set permission on for a specific set of users to update, delete, etc and another set of user to only select, but I need these users to be able to change one ...
Score please help on count(distinct <expression>)
Carlos - 14 Jul 2006 6:44 PM - 4 messages
Hi all,   the sql parser does not like when trying to execute a query that has more than one column to be distinct within the count function. i.e. select count ( distinct a.ssn, a.term ) from mytable when I just leave one column (i.e. ssn), the count is executed normally, ...
Score SELECT INTO From Result Set
Jim - 14 Jul 2006 6:34 PM - 3 messages
Hi,         We are using SQL Server 2005.         Is it possible to fill a temporary table with the result set from a stored procedure?  I want to do something like this: ...
Score No rows returned
Mark Boettcher - 14 Jul 2006 5:54 PM - 11 messages
We have encountered a problem where a table has become 'damaged' (for lack of a better word) such that when we either attempt to perform an update on the table or do a simple query of 'select * from unit', the queries 'hang'. ...
Score Insert using subsqueries
KatMagic - 14 Jul 2006 5:49 PM - 4 messages
How can I do an insert, pulling data from one table to another, plus add more values -- if possible? For instance, I have a client table, with the id field as the primary key. I have tbl2, that references the id field, plus 3 other fields:  Cost, Date, ...
Score Disconnected rowsets
Robert Bravery - 14 Jul 2006 5:11 PM - 2 messages
HI all, I was wondering HOW DBA's handle things like this. Here is a scenario, simlpistict but real. Also multipl this by as many as you want to understand the potential proble,m A few salesman on the road, each with some kind of mobile device. THey are ...
Score SUM() gone wrong.
wmureports - 14 Jul 2006 4:19 PM - 3 messages
Ok, so I have a table that looks like this SessionID    CourseID    Users        1              10           100 ...
Score need help for a query
samuelberthelot - 14 Jul 2006 4:17 PM - 4 messages
Hi, Here are the records : house kitchen room garage livingroom bathroom I want to do a select that gets all those records ordered alphabetically (so bathroom comes first normally) BUT house should come first, and then the other records sorted. ...
Score Question for T-SQL Gurus
Dave - 14 Jul 2006 4:05 PM - 10 messages
I have a table that relates emails together.  I would like to leverage this information to create a rollup key that can be used to identify the entire group.  Some groups will have one email some will have many. ...
Score Query returning wrong data
Peter Newman - 14 Jul 2006 3:51 PM - 3 messages
im running this query as i need to have an index number for a vb.net datset "Select t1.*, (select count(*) from BossData.dbo.OriginatingAccounts t3   where t3.tblOA_Licence < t1.tblOA_Licence) as IdCol from BossData.dbo.OriginatingAccounts as t1 Where t1.tbloa_licence = 'TEST'  Order ...
Score Query help
HP - 14 Jul 2006 3:31 PM - 4 messages
Below is my view which returns 70,000 + records. It takes like a minute or more sometimes. How can I make it faster. With time the number of rows are going to increase and the query will take even longer. Please help how I can ...
Score sqldbtype.nvarchar in application but field is a varchar in database
Bill Youngman - 14 Jul 2006 3:19 PM - 3 messages
I have just taken over a project for my current client and have noticed several places in the existing application where the developer set the sql parameter dbtype to nvarchar in the application code but the field in the backend database is a varchar. What effect, if any can this have on the ...
Score SET ANSI_WARNINGS OFF: can this be table-specific?
thatsMaBoy - 14 Jul 2006 3:07 PM - 2 messages
Hi, I am using SQL Server 2000.  I know that it is bad practice to truncate data as it is lost but please could someone answer the following: 1. Can ANSI_WARNINGS be set to OFF on a table-specific basis, or is it ...
Score Table design request for comment. (Help please)
Mark - 14 Jul 2006 3:04 PM - 5 messages
Hi there gurus, can you please add your 2 cents on this design?  We're having trouble relating these tables in a diagram because of the keys. Is it necesary to have the references setup?  I would assume yes so the ...
Score Trying to avoid a stored procedure, is this possible?
Russell Verdun - 14 Jul 2006 2:42 PM - 3 messages
I have a single table that has two columns pkID & Notes. For each pkID there can be several rows, what I would like to accomplish and know if possible. Is to create a column, that I can number each row for a given pkID ...
Score Debugging in SS2005 ?
Joe Delphi - 14 Jul 2006 2:36 PM - 2 messages
Hi,      In SQL Server 2000, I am used to using the stored procedure debugging feature in the Query Analyzer to debug my stored procs.      We recently switched over to SS2005 and I am using SQL Server ...
Score Check if file exists then delete it
mdscorp - 14 Jul 2006 2:25 PM - 9 messages
I am almost done with my HUGE stored procedure and iowe it mostly to contributions from all of you guys, THANKS The last part of the T-SQL coding is I need to check for a file in the server , delete it before I attempt to re-create it with new data for ...
Score any idea how to decode hex time string '0x01 C6 56 B1 8C EA 40 00'
chentiangemalc - 14 Jul 2006 1:21 PM - 4 messages
Hi there, I'm trying to understand a database for which information is not available concerning how it writes time values. Here is an example: Start time: 0x01 C6 56 B1 8C EA 40 00   End time: 0x01 C6 57 7A B7 53 FF FF ...
Score Need help in writting query....
Mukut - 14 Jul 2006 1:10 PM - 3 messages
All, I am eagerly looking for your kind help in a specific problem as described below: I have source table S(suaId,subId), Destination table D(duaPId,dubPId). Also having tables  UA(duaPId,suaId)  &   UB(dubPId,subId). ...
Score Sql 2k UDF help
Fabri - 14 Jul 2006 1:07 PM - 3 messages
I don't understand why in this UDF: ======================================================================= create function dbo.MyUDF(@dove varchar(100)) returns varchar(8000) as begin     declare @out varchar(8000)     set @out = ''     return     (     select @out = @out + ';' + TC.name ...
Score Stored Procedure Problem
Tiger - 14 Jul 2006 1:00 PM - 6 messages
New to SQL and Stored Procedure. Been reading up where I can. Trying to create a stored procedure that does the following. Reads in a value from an ASPX dropdown (@SST), reads in a value from a another ASPX dropdown (@acct_no).  Takes the following user input data to the ...
Score VIEW's ORDER BY columns necessary in column list
Keith G Hicks - 14 Jul 2006 12:40 PM - 21 messages
I recently created a view (based on another view) that has an ORDER BY in it that is requiring that the ORDER BY columns be listed in the column list after the view name. This is the first time I've encountered this and am ...
Score connect to oracle database
Xavier - 14 Jul 2006 12:10 PM - 9 messages
hello, i want to connect to a oracle database. Now in VS2005 whaen i select the oracle driver i get the message: System.Data.OracleClient requires Oracle client software version 8.1.7 or greater. Must i install a oracle client? .... ...
Score Rights Question
Bart Steur - 14 Jul 2006 11:21 AM - 3 messages
We have setup our SQLServer 2000 as follows: We added the entire domain group ICT as login. So at the Logins view in Enterprise Manager is shows DOMAIN\ICT. The group ICT in the domain contains three (3) users. One of the users is JTB. ...
Score Vertical Partitioning Advice
Chris - 14 Jul 2006 10:45 AM - 5 messages
I have a large table which has grown to 162 columns. For better performance, I am considering Vertical partitioning to split this single table into smaller tables [Orders : OrderProperties : OrderExtendedProperties ] using views to combine when needed. I've done a lot of online research to find best practices for creating this ...
Score Running .sql file using C#
Gislain - 14 Jul 2006 9:16 AM - 4 messages
Hi, I'm trying to run .sql file with C# code, but i have systematically an error message with the "GO" instruction. When i test the script in SQL Server Management Studio, it work fine !!! First part of the error message ...
Score decimal (28,2)
Martin - 14 Jul 2006 8:51 AM - 2 messages
I have defined my decimal fields with decimal (11,2). I have also defined parameters in VB.Net where I set SqlDBType.decimal without setting a size or precision (). When I look at the statement using SQL Profiler, my decimal parameters are ...
Score Restoring Master Database
Lontae Jones - 14 Jul 2006 7:06 AM - 3 messages
I want to restore Master database from one server to another. I set the database in single user mode and restored and the database send it restored successfully but when trying to access SQL the agent wouldnt start. ...
Score real-world query - too difficult for me!
Jim Lawton - 14 Jul 2006 6:46 AM - 6 messages
I have to resolve this problem - I have various ways I can do it, but I don't know enough SQL to do it in a single query (I have to do that, because the solution is cross-platform, and has to wrk where stored ...
Score Made for Software Engineers!
Staffbucks - 14 Jul 2006 6:22 AM - 1 message
Finally a Good News for Software Engineers to find quick jobs: - Extend your network extensively to reach IT Managers, Hiring Managers and Well Placed Recruiters. - Find a Job at the Speed of Light! - Negotiate and Get the Best Salary/Rate. ...
Score opening SQL server 2000 MDF + LDF file from DVD
chentiangemalc - 14 Jul 2006 6:16 AM - 9 messages
Hi, I'm in the process of writing an application to open a database as read only to view historical log data on a DVD. The databases were created with SQL Server 2000. I am able to open them with SQL Server 2005 Express Edition, but ...
Score Mask certain number of a Credit Card Number?
Marco Napoli - 14 Jul 2006 5:20 AM - 5 messages
I have a VarChar field that stores Credit Card numbers, is there a way in a SELECT statement to mask certain portions of the Credit Card Number? For example:   1234-5678-9012 would show as xxxx-xxxx-9012 ...
Score DateTime Question (Again)
Jeremy - 14 Jul 2006 4:51 AM - 7 messages
I posted a question earlier today (9:25 AM). Subject: Storing DateTime Values - Sometimes with time, Sometimes without. If you review that thread you'll see how quickly it got WAY off topic. So I hope it's not considered rude for me to repost the same question again ...
Score How to execute a combined SQL character string in stored procedure
Joseph Lu - 14 Jul 2006 4:11 AM - 3 messages
hi all,      could any one tell me how to execute a combined SQL string in stored procedure, thanks! my code as follow: /*******************************************/ CREATE procedure sp_copy3sectable @tblname varchar(10) as declare @sqlstr varchar(50) set @sqlstr = 'select * into ' + @tblname + ' from tbl_3sec' ...
Score How to do row level locking in SQL Server 2005?
Connie - 14 Jul 2006 4:05 AM - 14 messages
Hi, For example, there are 2 users connecting to the same table and want to update the different rows. They are requested to use the row level locking. Pls advise and provide the example of sql statement or sample code. ...
Score Which syntax is better in SQL?
Ronald S. Cook - 14 Jul 2006 3:27 AM - 17 messages
Three quick questions on SQL syntax if you don't mind.  I appreciate your response. In my code below, 1) Is it necessary to put things in brackets?  Since we use Hungarian notation, we'll never have a naming conflict with a SQL reserved keyword. ...
Score FOREIGN KEY that REFERENCES a server login for a database?
Gary - 14 Jul 2006 2:18 AM - 6 messages
Hi, I have a table which includes a ([login_sname] sysname) column (used for row-level security, SUSER_SNAME() joins). However, I am having trouble figuring out how to add a FOREIGN KEY (login_sname) constraint, which REFERENCES valid server logins for a given database. Using ...
Score Does CONVERT update the source data
shallcooper - 14 Jul 2006 1:35 AM - 9 messages
Can I use the CONVERT function to change the way a date/time is displayed in a query without actually commiting the change to the database? Please excuse my ignorance. Further, how do I convert the date/time into mmm-yy format? ...
Score ALMOST DONE, I THINK?
manmit.walia - 14 Jul 2006 1:03 AM - 2 messages
Hello All Developers and SQL Gurus. I am almost complete with my query thanks to Jeff Tuner a fellow Google Groups user. This is what my final table structure looks like and along with my queries. The query below works fine only does 1/2 of what I ...
Score Could we use query in From clause?
Elham - 14 Jul 2006 12:45 AM - 6 messages
Hi guys I am trying to create a query which counts records for all tables in a database. But it seems that I can't use query in From clause as I recieve errors. Any idea how I can have such a query with variable value in From section? ...
Score SQL Replace If
shallcooper - 14 Jul 2006 12:21 AM - 14 messages
I have a small list of names. I want to create a table with two columns using this list. The first would be the names as per the list. The second would replace all the males names with 'Male', and the female ...
Score General design question
Daniel - 14 Jul 2006 12:00 AM - 2 messages
Hey guys I have to do a database for a poker site and it requires storing everything. I notived other places such as party poker have hand numbers and table numbers and i presume all these come from a database. However they use ...
Score How to take a BACKUP of a single or more Tables in Sql Server
ch.adilaziz - 13 Jul 2006 10:30 PM - 3 messages
I want to know that how to take a BACKUP of a Table in Sql Server.If any one can help me with this issue. Thanks ...
Score CLR out of memory
Abe - 13 Jul 2006 10:30 PM - 3 messages
I've got a CLR function that runs fine on my workstation running SQL Server Express; however, it throws OOM exceptions on the full SQL Server 2005. The function is very simple: it takes an XML file and a stylesheet, ...
Score SSIS data flow design
Mitch - 13 Jul 2006 9:37 PM - 1 message
I am designing my first DTS pkg in SSIS Designer.  I am in the Data Flow tab.  I have created a 'box' that successfully connects to an Excel worksheet named range (table) on my network.  It connects to another 'box' for data conversion ...
Score Convert Query from access
kohai - 13 Jul 2006 9:13 PM - 5 messages
Hi, I'm learning to use sql server ('00) and am trying to convert this query from access that will count the # of increases, declines, and no changes for a field. SELECT dDate, Grp, Sum(IIf([DRet]>0,1,0)) AS Adv, Sum(IIf([DRet]<0,1,0)) AS ...
Score Backup SQL Server database to UNC
Richard Mueller - 13 Jul 2006 7:43 PM - 9 messages
Thanks to Tracy McKibben and Geoff Hiten for pointing me in the right direction in a previous post. However, I found another solution. In order to backup an SQL Server database to another machine, you must specify a UNC path to a share. The backup is performed with the credentials ...
Score sql query - sp
SAM - 13 Jul 2006 7:27 PM - 22 messages
I created a stored procedure to return a number of leads for customers, the list of metro cities between a specific time frame and group by time frame This is working but I also want it to return the list of metro cities even ...
Score loop though records and CONCATENATE results
mdscorp - 13 Jul 2006 6:59 PM - 8 messages
i am writing  stored procedure that will allow me to create a flat file to be send to another company. in order to do this I need to write a query, create a cursor or temp table for each main record meeting ...
Score Grouping in Derived Tables
IraG - 13 Jul 2006 6:21 PM - 8 messages
Suppose you have a query involving an aggregate on a derived table such as: SELECT C.CustomerID, C.CustomerName,  C.CustomerType, C.Address1, C.City, C.State, S.TotalSales FROM  Customers C INNER JOIN   (SELECT      CustomerID, SUM(SalesAmount) as TotalSales ...
Score Syntax for selecting all but one
lord.zoltar - 13 Jul 2006 6:09 PM - 15 messages
Quick question: Is there any syntax to select all except 1 or 2 columns? I have a table with 80+ columns, and I want to return all of them except 1 or two, which I will convert when I select them. ...
Score Slow performance in UDF from a sql job.
kshatalov - 13 Jul 2006 6:05 PM - 3 messages
We have a problem that we have been wresting with for the last month with no success. Any help would be greatly appreciated! We have a complex stored procedure that has been running very slow from within SQL Job but only for a couple of hours every morning, then it ...
Score wierd sql query problem
Smokey Grindle - 13 Jul 2006 5:37 PM - 11 messages
I dont have an DDL for this so I am just going to write it out by hand CREATE TABLEA (     AddressID        BIGINT,     Address1        nvarchar(100), ...
Score SSIS
John - 13 Jul 2006 5:34 PM - 1 message
Can anyone tell me how to view ssis packages after you create them?  I am expecting there is an addin or someplace to view them inside of the management studio. Thanks ...
Score Full Text Search - Weighing COLUMNS differently in queries
dddean - 13 Jul 2006 5:19 PM - 5 messages
Hi there, I've created an FTS Catalog based off an indexed view.  For example purposes, say it has two columns: Name, Description. Is it possible to perform one query that will search both columns, but have them weighted differently (ie: Name carries much more weight than ...
Score INFORMATIONSCHEMA nullable
Klaus Wiesel - 13 Jul 2006 5:05 PM - 6 messages
Hello using INFORMATIONSCHEMA.COLUMNS I get IS_NULLABLE as varchar ("NO"/"YES") 1. Is this always english (constants NO and YES) or does it depend on settings ? 2. Is there a way to get a boolean from this column (language save cast)? ...
Score sp_executesql: How to have a parameter within a string
Johnny Ortega - 13 Jul 2006 4:50 PM - 4 messages
If I execute exec sp_executesql N'sp_helpindex N''[dbo].[authors]''' within EM/Mgmt Studio, this statement runs fine. If I try and parameterize it, like this: exec sp_executesql N'sp_helpindex N''@QualifiedTableName''', N'@QualifiedTableName nvarchar(15)', @QualifiedTableName = N'[dbo].[authors]' ...
Score Storing DateTime Values - Sometimes with Time, Sometimes Without Time
Jeremy - 13 Jul 2006 4:25 PM - 15 messages
What is a standard or acceptable practice for storing datetime values in a column for which 1. the date is always known 2. the time may not be known (say 40% of rows do not have a time value). Specific question: What value is to be stored for the time value [of the ...
Score Trying to copy a row in a table
Taliesinson - 13 Jul 2006 4:11 PM - 4 messages
I need to take a row in a table, and duplicate it in that same table, while changing the values of two columns.  Can anyone give a suggestion of the easiest way to do this?  Currently I am trying to dump the data to a temporary table, changing the ...
Score Is this possible? Recursive data structure...
zanthor - 13 Jul 2006 4:00 PM - 6 messages
I am designing a document management system and wanted to impliment groups similar to what you would find in Active Directory... Basically I want to query a table and have the SQL server go through the results, and based on a value returned per row either output that ...
Score sql 2k view with Union duplicating records
Ben - 13 Jul 2006 3:54 PM - 3 messages
Hi We have a view that appears to be duplicating a record. We have two tables identical struction apart from one additional field (which is replaced with a null in the other table within the view).  We have a view that joins the two tables showing all fields, it is a basic union ...
Score What is best way to manage database changes?
Ronald S. Cook - 13 Jul 2006 3:20 PM - 12 messages
I'm wondering what "best practices" there are out there for keeping control on what has been deployed to a database. I've seen some companies have files (e.g. 001.sql, 002.sql, 003.sql) that keep up with incremental changes in a database (e.g. new procs, changes to ...
Score User-defined function not show up after being created
Emily - 13 Jul 2006 3:01 PM - 8 messages
Hi All, I created the following user-defined function. It passed the syntax check so I selected "OK". However, it was not added to the list under "User Defined Functions". Anyone can tell me what is wrong with my UDF? ...
Score Nested Queries Help
shil - 13 Jul 2006 1:47 PM - 4 messages
Hi, Seems like very simple but I couldn't figure out why I'm having issues with nested queries. I have two tables T1 and T2 in which there is a common field which is SoldTo. Here T1 is a master table from which I insert data into T2 if ...
Score How to insert and retrieve multimedia files into/from database
vinayan.ur - 13 Jul 2006 1:35 PM - 1 message
How to insert and retrieve multimedia files into/from database? Also can anyone help me how to use .net to do the same thing using sql ...
Score Using functions in a join... referencing columns
stainless - 13 Jul 2006 1:26 PM - 3 messages
This problem is tricky to explain but I'll give it a go. I am trying to build a single select statement that takes a data column from a join early in the select and passes this into a function in a ...
Score How can I Rearrange my Data
wmureports - 13 Jul 2006 1:22 PM - 14 messages
I have a report currently, It shows everything I need it to show. Heres how it looks.  It shows what areas have completed what courses and how many total completions it has Area           Course ID       Total ...
Score Error Handling not workinh after select a bad table
sevlar - 13 Jul 2006 1:18 PM - 5 messages
Hi guys, I have a SP that is executing a simple task, and I´m forcing an error, but the SQL Server is not catching the error, please help me. The code is: insert into table1                select * from table2_bad ...
Score Select data that can't be converted.
R1gg4 - 13 Jul 2006 1:08 PM - 7 messages
Hi all, I have a table with a string column, most of the data in there is in a format that can be converted into a datetime type. How can i just retrieve the rows that cannot be converted? ie.. ...
Score Trying to find out what records are accessed and what are garbage.
UJ - 13 Jul 2006 12:43 PM - 3 messages
I have a program that reads a parameter table. The table has gotten quite big and I don't know what values are actually used and what aren't. I have a stored proc that you can call to get a value from the table but not ...
Score Build Querys for external data sources
Chris - 13 Jul 2006 12:31 PM - 6 messages
Hello, I am trying to use SQL2k5 to import and analyze data from various thrid-party Visual Fox Pro database applications we have.  I'm stuck having to use SQL 2000 for now because I cannot figure out how to ...
Score tring’
RobRoma - 13 Jul 2006 12:06 PM - 15 messages
Hello! I’m using a statement with LIKE in the WHERE clause. Searching for rows containing a prefix (LIKE ‘MyPrefix%’) SQL Server seeks the index on that column – that’s fine. But if I want to search for a suffix (LIKE ‘%MySuffix’) ...
Score Top behaviour
Norbert Meiss - 13 Jul 2006 11:47 AM - 7 messages
Hi, I use a dynamically crafted SQL Statement to show the newest n orders for a given customer: SELECT     TOP 15 dbo.vADR_subORD.* FROM         dbo.vADR_subORD WHERE     (ADR_Key = 17519) ...
Score using getdate with a default param in sp
Yan - 13 Jul 2006 7:42 AM - 4 messages
I am not sure how to do this correct. I have a nullable datetime column and I would like to update the values in this column via a stored procedure which has a default param of getdate() for the column. ...
Score Query taking long-long time
neeju - 13 Jul 2006 7:40 AM - 8 messages
Hi, We are having performance problem with the below mentioned query. This stored procedure execution takes around 30 hours to complete. This fetches around 18 Million records. This process runs in three steps. 1:-  Query fetches 18 million records from one database and insert it ...
Score Cross Table Query
Carl - 13 Jul 2006 7:23 AM - 4 messages
Can SQL 2000 perform a cross table query like MSAccess97 eg: TRANSFORM Sum(Hours) AS [The Value] SELECT Resource, Sum(Hours) AS [Total Of Hours] FROM tblHours GROUP BY Resource PIVOT Format([Start_Date],"mmm yy"); ...
Score Executing DTS package as Other Loggin
Carl - 13 Jul 2006 6:11 AM - 2 messages
I'm trying to have a DTS package execute by the SQL server agent (ie on a schedule). The package executes fine when I manually run it from Enterprise Manager but fails when scheduled. The latest schedule history is: "Executed as user: ATEA\SQLExec. ... OnStart:  Drop table Results Step ...
Next »