Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!


Archived Months
January 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


all groups > sql server (alternate) > may 2004

Filter by week: 1 2 3 4 5

can u help with my select ?
Posted by Krzysiek at 5/31/2004 7:29:42 PM
Hello All, I have a simple table with 2 columns. datetime int 27.05.04 1 29.05.04 2 31.05.04 5 and i need to get a view that looks like this below : 27.05.04 1 1 29.05.04 2 3 31.05.04 5 8 The third column shows a sum of numbers that were display before ...more >>

Creating roles
Posted by newtophp2000 NO[at]SPAM yahoo.com at 5/31/2004 5:20:29 PM
Hello, I know there is sp_addrole and sp_droprole to create roles. I just found out that I could not use these two statements in an application because the application is interacting with the database within transactions through ODBC (SQLServer complains that these two stored procedures cann...more >>

cross tab or derived table
Posted by contactmirth NO[at]SPAM yahoo.co.uk at 5/31/2004 5:59:37 AM
Hi all, I have a table in this format colname1 colname2 colname3 col1data1 col2data1 col3data1 col1data2 col2data2 col3data2 col1data3 col2data3 col3data3 col1data4 col2data4 col3data4 I want to display it in this format colname1 col1data1 col1data2 col1data3 col1data4 colname2 co...more >>

Like statement
Posted by jim.ferris NO[at]SPAM motorola.com at 5/31/2004 12:13:07 AM
I need to build a bunch of dynamic like statements '% ' or '% %'. heres an example of one that im working on just to test.. declare @check varchar(50) set @check = 'Bad' declare @select varchar(50) set @select = 'select * from art where style like %' + @check + ' and inventoryid =13' ex...more >>

sql server 2000
Posted by gun_reddy NO[at]SPAM yahoo.com at 5/30/2004 11:17:22 PM
I am trying to import a text file with an Access 2000 front end application and The application has SQL SERVER 2000 as the back end. when i try to import the text file I am getting the error below. Could not bult insert because the file could not be opened.Operating system error code 3(the syst...more >>

possibile che ...
Posted by ernix at 5/30/2004 9:10:00 AM
nessuna sappia dirmi come convertire un database mysql in sql server? Avrei bisogno di visionare graficamnete le tabelle e le loro relazioni. Qualcuno può darmi una mano? Grazie infinite ...more >>

Calling All T-SQL Gods & Goddesses
Posted by theintrepidfox NO[at]SPAM hotmail.com at 5/29/2004 12:19:20 PM
Hi I'm having trouble with the script below that it just won't do a correct ORDER BY for a date field. When executing the two SELECT TOP statements on their own the records are sorted correctly but when wrapped in the main statement, the ORDER BY is just ignored. Tried to play around with t...more >>

How to Spec a SQL server
Posted by matt NO[at]SPAM fruitsalad.org at 5/29/2004 1:05:27 AM
Hello We are upgrading our DB server to a new machine and there is a heated debate about what spec machine to use. We have on this server a 15 GB DB that handled around 2-3 million transactions / day, 50% updates and 50& reads roughly, the main goal since it is used by an interactive end us...more >>



SqlServer changes cursor to "read only"
Posted by newtophp2000 NO[at]SPAM yahoo.com at 5/28/2004 9:10:03 PM
I am trying to write a cursor to update certain rows in a particular order as follows: (I need the cursor version, not SQL, as the update logic depends on the order of rows and some other conditions. I removed the Order-By clause from the statement to simplify it; it gives the same error messag...more >>

Scripting "INSERT"s in an SQL database?
Posted by Robin Tucker at 5/28/2004 6:32:50 PM
Hi there, Getting ready for deployment and I would like to be able to run an install script that will not just generate the schema, but fill in some of the tables with default data. Is there a tool out there that will scan user tables in an SQL database and generate the script required in ord...more >>

Yet another BCP issue
Posted by bkc98 NO[at]SPAM excite.com at 5/28/2004 12:03:15 PM
Hello all, Background: I've posted a couple questions recently regarding using BCP to extract many tables to text files. I've written an extract application that bcp's about 100 tables from a database to text files. I've run into a couple limitations using BCP, but I finally landed on (what I...more >>

multiple result sets
Posted by Darko Jovisic at 5/28/2004 11:53:13 AM
Hi! Another silly question: If a stored procedure returns multiple result sets, how do I choose the one I want to insert into a table? For example sp_spaceused returns two result sets if object name is ommited. I only need the first result set. How do I do that? Tnx! Darko ...more >>

CASE with empty parameter
Posted by Not Me at 5/28/2004 11:30:51 AM
Hi, I can't seem to get this where clause to function as I wish.. must be something simple but I can't see it! have tried ac.coursename like CASE @course WHEN null THEN '%' ELSE '%' + @course + '%' ac.coursename like CASE @course WHEN '' THEN '%' ELSE '%' + @course + '%' ac.coursename like CA...more >>

Norton Anti-Virus Affecting SQL Across Network
Posted by mhawkins19 NO[at]SPAM adelphia.net at 5/28/2004 9:29:08 AM
Norton Anti-Virus Affecting SQL Across Network-- I help maintain a small software package developed using Microsoft Visual Basic that utilizes Microsoft SQL Server. I'm having major speed issues when it comes to making queries across the network. I have tracked the problem down to Norton Ant...more >>

Scheduled jobs overlapping
Posted by Aleksandar Andjelkovic at 5/28/2004 8:46:18 AM
Greetings, I have Full database backup job scheduled at 02:00 every day, Differential backup every 2 hours from 00:00:00 to 23:59:59 and Log backup every 15 min from 00:00:00 to 23:59:59. Is there a way to control order of execution, for example: Full backup starts before Differential backup a...more >>

Help setting up SQL2000
Posted by lankids NO[at]SPAM brandalls.net at 5/28/2004 6:38:08 AM
I am assigned to setup a small (less than 15 PC) network, accessing a database server(SQL2000). I am wondering if I can use XP Home (which we already have)for the clients and setting them all (including the server -WS2003-) as workgroup? Or do I need a domain to setup the connection to the datab...more >>

Select lookup code values problem
Posted by Steve at 5/28/2004 5:00:58 AM
I have a table called Orders with three fields, OrderID, Action,Status. Action and Status are code values with FK lookup to dbo.Action and dbo.Status respectively. Is it possible for me to return not just the code values but the filed names? For example: SELECT OrderID,Action,Status FROM Ord...more >>

PRINT command Not Working For Database Client
Posted by ehchn1 NO[at]SPAM hotmail.com at 5/27/2004 11:05:55 PM
Hello, The PRINT command works fine on Query Analyzer. However, when I used it with other Database Client, eg: Aqua Data Studio, nothing got printed out. Is there a way to make it work? Thanks in advance....more >>

Why is my Data Import going so slowly?
Posted by Warren Wright at 5/27/2004 7:16:20 PM
Hi group, I have a 175MM record table, with a record length of 200 bytes (about 20 columns). Sometimes when I run a very simple DTS to import our monthly text file of new records (about 10 million records) it really flies (takes less than an hour or 45 minutes). However, sometimes it tak...more >>

How to transform fact table only by SQL?
Posted by mrazek NO[at]SPAM compik.fd.cvut.cz at 5/27/2004 7:15:26 PM
Hi, this is easy with OLAP tools, but I need to do it just with MS-SQL server: fatTable year type val 97 a 1 97 b 2 97 c 3 98 a 4 98 b 5 98 c 6 .... year type_a type_b type_c 97 1 2 3 98 4 5 6 99 ... The problem is number of different types - not just 3 like a,b,c but more tha...more >>

Query Assistance for Newbie
Posted by Ray Bannon at 5/27/2004 5:50:00 PM
I need to modify a query through which I've done mostly using the Query builder in Enterprise Manager so it can be run periodically without manual editing. The query builder creates the following text: select [ATHSTATDATA].[NSTATEVENTID] as "Page or Search",[ATHSTATDATA].[NDATA] as "Hits if Se...more >>

DBCC and Failed Assertion Errors - HELP!
Posted by mleppink NO[at]SPAM hotmail.com at 5/27/2004 3:55:12 PM
Hey all - We are running SQL 2000 with ALL available service packs, etc. applied. We just built a brand new database server, which has dual 2Ghz XEONs, 2GB memory, and the following disk configuration: RAID 1 array (2 disks) Operating System Windows Server 2003 RAID 1 array (2 disks)...more >>

Who is in a database ?
Posted by Jim Andersen at 5/27/2004 2:32:54 PM
Hi, Used the wizard to create a maintenance plan for a db. But it fails most of the time. I checked the log-files. At 1.00 AM, it runs the "Optimizations" job for 6-9 seconds. It succeeds always. At 1.05 AM, for 1 second, it runs "integrity check", but most of the time it fails, and says...more >>

Full-Text Search Query Question - Performance
Posted by jimdandy NO[at]SPAM shaw.ca at 5/27/2004 11:24:33 AM
I have a table with 3M rows that contains a varchar(2000) field with various keywords. Here is the table structure: PKColumn ImageID FullTextColumn There is an association table: ImageID ContractID Now, I want to do a query where the ContractID = x and Contains some word in the Fu...more >>

SQL for Modeling Generalization Hierarchies
Posted by robertbrown1971 NO[at]SPAM yahoo.com at 5/27/2004 9:56:05 AM
Is there a good approach to modelling many heterogeneous entity types with that have some attributes in common? Say I have entities "employees" which share some attibutes (e.g. firstname, lastname, dateofbirth) but some subsets of employees (e.g. physicians, janitors, nurses, ambulance drivers...more >>

Breaking out data from a text field type
Posted by mrea NO[at]SPAM ohiotravelbag.com at 5/27/2004 9:09:23 AM
In my database there is a text field type that is used to enter street address. This address could be a few lines long, each line with a carriage return at the end. Is there a way to search for these carriage returns and break out what is in each line seperately? Thanks. Mike...more >>

Functions with global variables
Posted by newtophp2000 NO[at]SPAM yahoo.com at 5/27/2004 8:12:50 AM
Hello, I am porting a stored procedure from Oracle. It uses a variable that remembers its previous values from each invocation. (It uses a PRAGMA REFERENCES clause for those who are familiar with Oracle.) In other words, the variable in a particular stored procedure acts as a global variab...more >>

update tables from a csv file?
Posted by sunshinevaldes NO[at]SPAM yahoo.com at 5/27/2004 7:47:43 AM
Hello and thank you for your time. I have never worked with sql server and currently have a project updating the database. I have a CSV file as follows: id keywords (this field contains commas within) date I have a sql server table as follows with only the id populated. id keywords dat...more >>

connection problem to sql 2000 on windows 2003 from Windows 95
Posted by mmagi NO[at]SPAM itconsult.it at 5/27/2004 7:20:37 AM
Hi all, I have a Windows 2003 server, which is also a terminal server for application, with sql 2000 installed. My company has developed an application that uses SQL 2000 as its database. The application is a client/server one. In each client computer there's a link to the application on the se...more >>

Whats wrong with this nested while loop?
Posted by jim.ferris NO[at]SPAM motorola.com at 5/27/2004 6:43:30 AM
Im getting way too many rows retured..what its trying to do is insert a 0 for revenue for months 7 - 12 (aka July through December) for each of these cost centers for each payor type..Im getting a lot of repeats and the concatenation field date always comes back as January 2003 instead of the mo...more >>

password protecting data
Posted by radhakrishnan_c NO[at]SPAM infosys.com at 5/27/2004 5:36:21 AM
Hi, I need to provide a facility to do routine database administration (backups, etc.) without allowing the logged in user to modify the data in any of the SQL server tables. Is there any way to accomplish this (such as maybe password protecting the tables or otherwise)? I am fairly new to S...more >>

Problem in Right Outer join query
Posted by omavlana NO[at]SPAM rediffmail.com at 5/26/2004 10:27:00 PM
Hi, I need your help to resolve this problem. I have written a right outer join query between 2 indipendent tables as follows. select b.Account_desc, b.Account, a.CSPL_CSPL from Actual_data_final a right outer join Actual_account_Tbl b on a.account_desc = b.account_desc where (a.source_type...more >>

BCP utility replaces German with junk characters
Posted by mcmanoj_2000 NO[at]SPAM yahoo.com at 5/26/2004 9:42:20 PM
Hi All, I am using command line bcp utility of SQL Server to import data from a text file to database. I have some german words in the text file and after import the German characters are lost. see eg below. Input : Kühner, Klaus -> Text file value OutPut: Khner, Klaus -> Table data, ...more >>

Right outer join problem
Posted by omavlana NO[at]SPAM rediffmail.com at 5/26/2004 9:01:01 PM
Hi, I need your help to resolve this problem. I have written a right outer join query between 2 indipendent tables as follows. select b.Account_desc, b.Account, a.CSPL_CSPL from Actual_data_final a right outer join Actual_account_Tbl b on a.account_desc = b.account_desc where (a.source_typ...more >>

Advanced SQL Query Problem ...
Posted by fschen NO[at]SPAM biztrak.biz at 5/26/2004 9:00:56 PM
Dear Expert, I have 2 tables as the following, Table : Product Column : ID, Code, Name Table : Trx Column : Trx_ID, Trx_Date, Product_ID How can perform the following query in MSSQL or is there any other way to perform the same query ??? For you info I can do this in Sybase and it...more >>

last row
Posted by Darko Jovisic at 5/26/2004 7:35:26 PM
Hi! Another problem: How can I fetch only the last row in my table? Thanks, Darko ...more >>

stored procedure result set
Posted by Darko Jovisic at 5/26/2004 2:47:31 PM
Hi! How can I save a result set from a stored procedure into a table? Can you show me some examples? Thank you! Darko ...more >>

Triggers
Posted by Jason at 5/26/2004 2:23:39 PM
Hi, I have two tables TblEmployee and TblEmployeeUpdates. If I create a trigger to copy deleted records from TblEmployee into TblEmployeeUpdates I would use: CREATE TRIGGER Employee_Updates ON TblEmployee AFTER DELETE AS INSERT INTO TblEmployeeUpdates SELECT * FROM DELETE This works ...more >>

Problem with a temp table
Posted by jim.ferris NO[at]SPAM motorola.com at 5/26/2004 2:23:07 PM
For some reason the compiler is telling me that I must declarethe variable @costcenter_tmp on lines 74 and 98...but if i put a select statement in ther (for testing) before the loop I get data back from the temp table.. why is this happening to this temp table and no others?..heres my code..i...more >>

Timeout / Obtaining a connection from the pool - Please Help!
Posted by theintrepidfox NO[at]SPAM hotmail.com at 5/26/2004 1:45:43 PM
Dear Group Sorry for posting this here. I'm desperate for a solution to this problem and thought some of you might have come across it with .NET and SQL Server. Let's assume I've the following code: Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handl...more >>

how to drop all keys & indexes
Posted by Woody Rao at 5/26/2004 1:44:15 PM
I'm trying to drop all indexes and primary keys so that i can rebuild them (from a script created from same database on another server). when i go to the 'generate sql scripts', it has the ability to drop or generate all tables. it also has the ability to generate all keys only. but i cant f...more >>

select into withidentity
Posted by newtophp2000 NO[at]SPAM yahoo.com at 5/26/2004 1:41:48 PM
I am trying to copy data from one table to another, and in the process add a sequence number to copied rows. I have looked at the IDENTITY function when creating tables, and essentially this is the behavior I am trying to duplicate. However, my question is if I can do this with the SELECT INT...more >>

Disabling primary key
Posted by Ghulam Farid at 5/26/2004 1:36:24 PM
Hi i have a table with primary key defined on col1 and col2. now i want to have col3 also included in primary key. when i alter the table it gives me error for duplicate rows. there is an option for 'with nocheck' but it only works with check or foreign key constraint. is there any option i...more >>

question about retrieval of client process IDs
Posted by korovyev NO[at]SPAM rambler.ru at 5/26/2004 12:47:37 PM
Is there any short way to make the server give out IDs of all client processes connected to a specified DB? I guess this information must be stored somewhere in system databases......more >>

Update Top 30%
Posted by gelangov NO[at]SPAM hotmail.com at 5/26/2004 12:31:02 PM
I want to update top 30% of a table. Is there a way without creating a separate table? create table temp_tableA (jobno varchar (20), formno varchar (20), otherinfo varchar(20)) truncate table temp_tableA insert into temp_tableA values ('1', '1', 'aaa') insert into temp_tableA values ('1', '...more >>

long query alert
Posted by Darko Jovisic at 5/26/2004 10:48:24 AM
Hi! How to create an alert that responses in case of long querya. I haven't noticed any counters that deals with these kind of situations? Thx for your help! ...more >>

last day of previous month
Posted by Killer at 5/26/2004 10:24:50 AM
How can i calculate the last day of the previous month? Help me,please ...more >>

Update all tables in database
Posted by muzamil NO[at]SPAM hotmail.com at 5/26/2004 8:10:22 AM
Hi My database contains , lets say, 100 tables. Out of these 100 tables, 60 tables contain both columns; Column1 and Column2. I want to: Update (All tables with BOTH of these columns) Set Column1 = Column2 Is there a better way of doing it? OR do I have to do it manually for each ta...more >>

Re: computational maple algorithm to TSQL
Posted by John Gilson at 5/26/2004 6:17:49 AM
A couple of months back a question was posted regarding ordered factorizations of numbers (see http://tinyurl.com/2n6s8), a combinatorial problem. Here's a relational solution that uses a branch-and-bound style approach. For a natural number N, let's call its ordered factorizations F where "...more >>

Embedded select query?
Posted by DarkChiild at 5/25/2004 7:42:04 PM
What I'd like to do is use the result of one query as the input for another. eg: INSERT INTO foo VALUES ( (SELECT id FROM people WHERE name = "bar"), 10, 'foobar' ) WHERE id = 1; Problem is, MSSQL wants a scalar value. Is there a way around this? Can someone tell...more >>


DevelopmentNow Blog