Groups | Blog | Home


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) > april 2006

Filter by week: 1 2 3 4 5

Trigger to encrypt field before write
Posted by rcamarda at 4/28/2006 11:28:31 AM
Hello, While working through my encryption questions from preivous posts, I am finding that I may have to resort to use triggers to do the encryption (not that this is the only way, but might be the best way for my circumstances). I would like to create a trigger that will encrypt the field bef...more >>

Problem deleting publication
Posted by Dave at 4/28/2006 9:44:37 AM
Hi All, I have a problem, a user deleted some tables from a couple db's dealing with replication. I now get this error on those db's. The process could not execute 'sp_repldone/sp_replcounters on servername I have deleted one of the database's and neither are listed under publications...more >>

Update statement
Posted by Munno at 4/28/2006 12:10:17 AM
Hi All, I am not so proficient in SQL and seek your help. I have a column by the name of Mask in a table, which has text eg. (YYYYYYYNNNNYYYYYYYYYNNYYYY). I wanted to update one particular value in that text. How would my update statement look like? Below is my select statement. select...more >>

SQL Function
Posted by Sean at 4/27/2006 4:43:39 PM
hello everyone, I created a function in MSSQL that builds an html coupon based upon the coupon ident (more complex than that, but that's not where i'm having problems!) When the function builds the coupon, it returns the stream as VarChar(8000) I am calling this function in a sproc that ...more >>

MySQL Cluster
Posted by Adam at 4/27/2006 12:15:44 PM
Hi Could somebody may explain me how works backup in clusters ? Thanks Adam...more >>

Conditional Query
Posted by Jeff Mason at 4/27/2006 11:10:01 AM
Hi, I'm trying to construct a query (in a stored procedure) which will have a number of selection criteria based on input parameters. There are a number of these parameters whose selection conditions they represent which all have to be true for a row to be returned in the resultset. The ba...more >>

VB (5or6) does something wierd with image data while saving to sql2000
Posted by geronimi at 4/27/2006 7:16:57 AM
Vb stores an image (bitmap/jpg) in a SQL2000 image field. For some reason it doubles the size by adding 00 for each byte. But sometimes it doesn't add 00 (0000.0000) but 01 or 20 or ?? and also the byte that should be transferd is changed... So SQLImageData = Imagebyte + 00 and sometimes SQLIm...more >>

Declare dynamic Cursor from String
Posted by peppi911 NO[at]SPAM hotmail.com at 4/27/2006 2:14:04 AM
Hi, is it possible to create a cursor from a dynamic string? Like: DECLARE @cursor nvarchar(1000) SET @cursor = N'SELECT product.product_id FROM product WHERE fund_amt > 0' DECLARE ic_uv_cursor CURSOR FOR @cursor instead of using this --SELECT product...more >>



Limits on rows in a table
Posted by chloe.crowder NO[at]SPAM bl.uk at 4/27/2006 1:33:18 AM
Hi We received the following in an email from a third-party supplier (who naturally has a solution for the problem as described). It sounds like gibberish to me, but does anyone have any comments? <quote> SQL in its current incarnation hits a performance brick wall when a table contains mo...more >>

sql query help
Posted by hharry at 4/26/2006 2:43:02 PM
hello all, i have this table: CREATE TABLE [dbo].[Table1] ( [person_id] [int] NULL , [dob] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO with these values: insert into Table1 values ('1', '15/12/1975') insert into Table1 values ('1', '01/01/1980') ins...more >>

SQL 2005 Encryption questions
Posted by rcamarda at 4/26/2006 10:45:03 AM
Hello, I have been researching the use of symmetic and asymmetic encryption in SQL 2005 and I am pretty excited to give it a try. Through examples, I can encrypt the data, but I cant figure out what to do next... What I want: 1. our social security field to be encrypted so that only the perso...more >>

SQLServer 2005 XML DataType is (almost) useless!!! (Please correct me if I am wrong)
Posted by John at 4/26/2006 9:53:17 AM
The XML Datatype does not support the case-insensitive search makes the XML DataType (almost) useless, if I stored the xml in the XML column, I certainly want to search it, if I could not performance case-insensitive search, why do I need store the data in the XML column? I try the followin...more >>

Please help quick statement check
Posted by David at 4/26/2006 5:01:55 AM
Hi, I was hoping someone could confirm the following about the following number 2 SQL query: 1. This extracts the data required given that there is a recording to match the records 2. This should, but im not convinced extract all the remaining records that do not have a matched recording, b...more >>

Compound Primary Key - order not as expected
Posted by John Rivers at 4/26/2006 3:52:19 AM
Hello, if you create this table: create table hello ( int a , int b constraint pk_hello primary key clustered ( a, b ) ) and then insert the following records a,b 1,1 1,2 1,3 2,1 2,2 2,3 3,1 3,2 3,3 and then do select a,b from hello the output seems to be: a,b ...more >>

SQL in Access Report
Posted by ApexData NO[at]SPAM gmail.com at 4/25/2006 3:34:50 PM
I have one table used to maintain information on Service Events. Each record contains a Repair, Maint, and Battery checkbox (bound/boolean). Any one of these fields may be checked or left empty. Ex. REPAIR=True, MAINT=False, BATTERY=True I want to generate ONE report that lists all the REPAIRS...more >>

Simple JOIN, INTERSECT query
Posted by David at 4/25/2006 1:58:34 PM
Hi, We are in the process of buying a new server to run mssql. However before this as a tempory fix to using a msaccess backend i believe through odbc i need to address the following issue: SELECT ai.entry_date as CallTime, ai.agent_login as AgentsLogin, ai.ca...more >>

How to performance case-insensitive search on XML data type in SQLServer 2005?
Posted by John at 4/25/2006 11:26:35 AM
Does anyone know how to how to performance case-insensitive search on XML data type in SQLServer 2005? Or I have to convert all the xml data to lower case before I store it? Thanks in advance. John ...more >>

How to page SQL query result returned from FOR XML statement?
Posted by John at 4/25/2006 9:40:57 AM
Gurus. I do not know if it is possible, but here is what I want to do. I want to allow user to page the SQL result, so he could decides to return from row 10 to row 20, or row 100 to 200, without returns the whole resultset. Every time he sends another request, I do not mind to hit the database...more >>

query hheeelp
Posted by Bandul at 4/25/2006 12:00:00 AM
Hi need help My english is not good so ill be short. This is my database create table customers ( customerid int unsigned not null auto_increment primary key, name char(40) not null, address char(40) not null, city char(20) not null, state char(20), zip char(10), coun...more >>

Removing embedded SQL from database application
Posted by Beowulf at 4/24/2006 5:45:10 PM
I inherited an existing database application about 6 months ago. I've finished converting it to use SQL Server 2000 as the backend (MS Access 2002 frontend w/ Userforms+VBA code pointing to the backend). In its current state the application makes use of a ton of embedded SQL statements and...more >>

SELECT and regular expression
Posted by Martin Lukasik at 4/24/2006 4:37:44 PM
Hi, I'm not a big friend of MSSQL, but I have to do one query I've done for mySQL. But I don't know how... I have to select 'user' from 'db' where first letter is E or N, second is B or 0 and after that there are 6 or 7 digits I know. How can I do that? In mySQL it would be something ...more >>

Cannot insert explicit value for identity...
Posted by nicolas.bouchard NO[at]SPAM gmail.com at 4/24/2006 11:25:27 AM
I am developing an integration process between two databases. One of them is a SQL Server 2000 and the other is using MSDE 2000. The integration process is done in C# (VS2003). The main database is the SQL Server, the MSDE will contain a really small subset of the data found on the main. To he...more >>

No distinct in a select into stement ?
Posted by Daniel Wetzler at 4/24/2006 8:59:01 AM
Dear MSSQL experts, I use MSSQL 2000 and encountered a strange problem wqhile I tried to use a select into statement . If I perform the command command below I get only one dataset which has the described properties. If I use the same statement in a select into statement (see the second se...more >>

SELECT * FROM "multiple_tables" WHERE "field_(in_those_tables)_have_the_same_paricular_value" ?
Posted by andro at 4/24/2006 12:04:40 AM
Hi everybody! I have several tables from which I want to exract the SAME value (along with other referenced data). All the values are in the same column within the tables. How can I achieve this? TIA. Andro ************************* example: (piping bill of material where tables rep...more >>

Sorting the result
Posted by Philippe Signoret at 4/23/2006 10:50:12 PM
If this is in the wrong group lemme know and I'll re-post it to the correct one. I am using PHP and MySQL. Suppose I have a table named "servicios" with 5 columns and 200 rows. If I want to get the whole table sorted by column 3 (suppose the field name is "nf") I use: SELECT * FROM `servi...more >>

backup failure
Posted by David Greenberg at 4/23/2006 4:42:01 PM
Hi My DB backup and transaction backup of a database keep on failing with the following error: Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 3202: [Microsoft][ODBC SQL Server Driver][SQL Server]Write on 'E:\SqlServer\testdb_db_200604221313.BAK' failed, status = 112. See the SQL Server er...more >>

SQL Server 2005 Import/Export not copying stored procedures
Posted by maflatoun NO[at]SPAM gmail.com at 4/22/2006 11:33:07 PM
Hi, In SQL 2000 if I wanted to take a complete copy of another running sql database all did was create a new database locally and right-click it and select import and point to another database and click copy everything (stored procedures as well) and it did it for. I can't seem to find the sa...more >>

instance of sql server
Posted by David at 4/22/2006 8:54:36 PM
I am learning SQL Server 2005 and I was told to install a second instance of SQL Server 2005 on my machine. How can I install a second instance of SQL Server 2005 on my machine I already installed SQL Server 2005, I guess this is my first instance. To install a second instance, do I just ...more >>

Search Between Times
Posted by balaji.balaraman NO[at]SPAM gmail.com at 4/21/2006 6:22:33 PM
Hi I'm new to SQl.. I have some monthly data which is being encoded as Varchar...Say for the month of January 2005 it wud look like '200501'. For each of my month I have a coloums which gives me datetime and volume of the job. This is what I'm doing Select Month, Time , Sum(Volume) ...more >>

Strange issue with SQL Table read only in Access
Posted by Rico at 4/21/2006 4:17:35 PM
I have a data file that I converted from Access to SQL Server using the upsizing wizard. I then attached the tables to the Access front end using an ODBC connection. I have one table that is read only for some reason. I'm not sure how that happened, it went through the same procedures as th...more >>

Exporting sql data to specific cells
Posted by Edgar at 4/21/2006 12:15:10 PM
Tools: SQL Server 2K, Excel 2000 Hi, I have an Excel report worksheet with formatted headings. What I want to do is to export data from the SQL server into a specific cell of the excel file. Is this doable? Can somebody give me some direction on how to accomplish this? I appreciate any...more >>

Trigger Question
Posted by mike at 4/21/2006 8:58:43 AM
I have a SQL based ERP package. Now I am having an issue on a particular table of people deleting a record (in the ERP system) and no one having any idea of who did it or when. So I thought I would setup a delete trigger so that when a record is deleted from a table it would populate a new ta...more >>

Need help with SQL satement - newbie
Posted by alanenglefield NO[at]SPAM gmail.com at 4/21/2006 7:50:18 AM
Hi all, I am a newbie with SQL and I have a statement that someone else wrote for me. It works up to a fashion but there seems to be a bug with it (or maybe I didn't make it very clear to start with ;-P). The statement needs to pull in details from a table. If there are more than one recor...more >>

security for row level but not based on Database user's login
Posted by Friends at 4/21/2006 3:27:44 AM
Hi I need to set security for row level but not based on Database user's login. It should be based on the user table login. For the particular user I need to allow only the particular records to access insert, update delete and select. Let me explain clearly For example think we are usin...more >>

Any functions to replace NZ in SQL Server?
Posted by Rico at 4/20/2006 8:25:47 PM
I'm moving some queries out of an Access front end and creating views out of them in SQL Server 2005 express. In some of the numeric fields, I use nz quite often, ( i.e. nz([MyField],0)) to return a zero if the field is null. Is there anything equivalent to this in SQL Server? Right now I'm ...more >>

SQL and Terminal on 2 different PC's
Posted by shawn at 4/20/2006 6:36:33 AM
In the past I have had SQL and Terminal server on the same PC. With SQL and Windows 2003 Terminal server, you can not have them on the same PC. How can I make this work with SQL and Terminal and 2 different PC's? I have 30 users that need to log on to my SQL database. ...more >>

Undo last statement
Posted by Jack at 4/20/2006 6:03:59 AM
Is there anyway in SQL Server to rollback an SQL statement which was already executed. I know there is a transaction log but what it contains and how it works is still a mystery to me. Assuming I delete all records from a table - can I somehow undo this? ...more >>

SQL and Terminal server on 2 different PC's
Posted by shawn at 4/20/2006 5:57:34 AM
In the past I have had SQL and Terminal server on the same PC. With SQL and Windows 2003 Terminal server, you can not have them on the same PC. How can I make this work with SQL and Terminal and 2 different PC's? I have 30 users that need to log on to my SQL database. ...more >>

Selecting rows from one table that are not in the other
Posted by Zvonko at 4/20/2006 12:00:00 AM
hi! I have two tables with same structure. I need to run a select query that will return only the rows from one table that are not in the other. In MySQL it would be select * from table1 MINUS select * from table2. but in MsSql I can not find the apropriate way to do this. Any He...more >>

Basic, perhaps silly SQLServer 2005 question
Posted by C.O.Jones at 4/19/2006 4:39:45 PM
I've previously used version 7 and 2000. I've recently started to learn ASP.net. I've installed Visual Web Developer 2005 Express and this includes SQLServer 2005 in the installation. The task manager and and the list of services definitely show I've got SQLServer running on my computer. ...more >>

Date (not datetime) datatype in 2005?
Posted by Larry Bertolini at 4/19/2006 4:38:10 PM
For some reason, I recall having read that SQL Server 2005 would support a datatype that represented date, but not time. (This would be useful for storing things like birthday, where you usually don't care about the time of day). But I've got SQL Server 2005 installed, and there's no such data...more >>

Restoring Master on another machine...
Posted by murrayb3024 NO[at]SPAM gmail.com at 4/19/2006 7:26:56 AM
We set up a test box and having been trying to move an entire instance from our production server to this one. I have moved all my created dbs using the RESTORE WITH MOVE. Now I am trying to move the Master, Model, and msdb. This is where I am having trouble. On the production box the dbs ar...more >>

Efficient SQL Backup?
Posted by Vishal at 4/19/2006 7:25:48 AM
Hi all, I am having issues of efficiency of backing up data from one SQL data base to another. The two servers in questions are on different networks , behind different firewalls. We have MS SQL 2000. On the source data i run a job with the following steps: 1> take trans backup every 4...more >>

Using IF inside SELECT ?
Posted by Igor at 4/19/2006 7:07:47 AM
Is there possibility to use IF conditions inside SELECT statements? For example, can i write something like this: CREATE PROCEDURE [search] ( @OPTION int, @KEYWORD nvarchar(40) ) AS BEGIN SELECT id FROM projects WHERE title LIKE @KEYWORD IF (@OPTION = 1) THEN (OR description LIKE @KEYWO...more >>

Get all records from Last Two Days?
Posted by John at 4/18/2006 6:27:18 PM
Hi Everyone, I use the following to get records from the last two days in MySql: where date_entered <= curdate() and date_entered >= DATE_SUB(curdate(),INTERVAL 2 day) I'm looking to do the same in MS-Sql server but I'm just not getting it. I've got this so far which does not work: whe...more >>

SQL Server Backup File Format
Posted by wolphie NO[at]SPAM hotmail.com at 4/18/2006 11:59:40 AM
The IT shop I work in installed MS-SQL Server last week for the sole purpose of converting a large MS-SQL Server database to a format that Informix (our main database engine) can read. MSSQL Server installed perfectly, I can view/manipulate the little "Northwind" sample database, back it up to ...more >>

Timeout errors
Posted by pb648174 at 4/18/2006 10:14:31 AM
After executing osql from the command line via the Windows scheduled task interface, the following error is returned: "Timeout expired" The code in the sql is as follows: BACKUP Database DBName to DISK='D:\Files\Backups\DBName.bak' WITH INIT go Is the timeout happening during the back...more >>

How to Get the 2nd the 2nd Record AND DISPLAY IN SINGLE ROW ?
Posted by heri at 4/18/2006 9:00:20 AM
Can you please assist me on how to get the 2nd record in case there are 3 or more records of an employee, the query below gets the MAX and MIN BasicSalary. However, my MIN Basic Salary is wrong because I should get the Basic Salary Prior to the 1st Record (DESC)in case there are 3 or more re...more >>

Time Over 24 Hours
Posted by vicyankees NO[at]SPAM gmail.com at 4/17/2006 10:19:17 PM
I am creating a report that has call duration and if i run it over a multi-day span the duration is limited to 24 hours and starts over at zero. is there a way to not limit hours? I am usign the following in my select statement: convert(varchar(12), dateadd(s, SUM(ISNULL(Calls.OutgoingCall...more >>

delete sql syntax for linked notes table
Posted by ProgrammerGal at 4/17/2006 3:27:05 PM
I am hoping this is a quick easy question for someone! :) I am trying (struggling) with moving data from Sql Server to a Lotus Notes table. I am using SQL Server 2000, I have a Lotus Notes linked server (using NotesSQL), and I wasnt to clear the table (delete all records) and then reloa...more >>


DevelopmentNow Blog