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 > june 2006 > threads for monday june 12

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 29 30

problem with like [^]
Posted by aneeshattingal at 6/12/2006 11:03:44 PM
SET NOCOUNT ON declare @tab table(vc varchar(2000)) insert into @tab select '10.1' insert into @tab select '10.1.1' insert into @tab select '10.1.2' insert into @tab select '10.1.1.1' insert into @tab select '10.1.1.1.1' The problem is that i need to select only 10.1.1 and 10.1.2 when i ...more >>


returning only first record of partition that exceeds threshold
Posted by Randy at 6/12/2006 7:44:02 PM
Hi Gurus Need some help. I have a account table with the following columns. I want to only see the first date the account threshold is >= 105 or 120 under theOCLWatch column. However, if I have consecutive dates that exceed my threshold I only want to see the first time it exceeds 105 or 1...more >>

VBA Access Insert New
Posted by jason.teen NO[at]SPAM gmail.com at 6/12/2006 7:24:05 PM
Hi, I'm making a form which simply just has one textbox and one button. When you type a name into the textbox and hit insert its suppose to add a new record to the "Name" Table. Here is what I have in my VBA code below: Private Sub btnInsert_Click() Dim strSQL As String strSQL...more >>

Use Stored Procedure on Multiple Schemas
Posted by dev648237923 at 6/12/2006 5:32:19 PM
I have three schemas that each have Table1: schema1.Table1 schema2.Table1 schema3.Table1. I have an SP that does work on that Table1 and for now I have three identical copies -- one for each schema: schema1.sp_Table1 schema2.sp_Table1 schema3.sp_Table1. I don't want to have the same SP...more >>

Auto field calculation
Posted by Simon Gare at 6/12/2006 4:31:54 PM
Hi, I would like to calculate field based on the entry in another in SQL server 2000 i.e.; field3 = field2 * field1 field1 field2 field3 10 2.5 25.00( =sum(field1*field2)) How do I go about this in the SQL DB itself, can it be done ...more >>

Can we use reporting services 2005 with sql server 2000
Posted by Larry at 6/12/2006 4:27:41 PM
We are on SQL server 2000. We have been writing reports using VS.Net 2003 and reporting services 2000. We are now upgrading to VS.NET 2005. But we can't seem to figure out how to do reporting services from VS.NET 2005, using sql server 2000 and reporting services 2000. I have looked a...more >>

Converting Access Code - FORMAT
Posted by Pancho at 6/12/2006 4:13:02 PM
Hello, A colleague passed me this make-table query which works in Access, and we'd like to automate in SQL. I did some basic debugging but now on parse, SQL returns that Trim and Format are not recognized function nameS. I think you can see the what formatting is doing to provide a standard...more >>

t-sql to merge tables and summary report
Posted by Carlos at 6/12/2006 3:48:07 PM
Hi all, I need to know what would be the most efficient statement to generate a new table based in the id of 3 different tables, and then generate a summary report based on categories. i.e. Table A Table B Table C id weight ...more >>



how to replace a character with line break in sql column's data?
Posted by cooltech77 at 6/12/2006 3:47:01 PM
Hi, I have a varchar(1000) column which is being populated from a CSV file using C# code.In the CSV file i first replace all line breaks with a '@' otherwise my code fails to insert into the table..I dont have any '@' in my input data. After inserting into the table I want to re-insert the l...more >>

Triggers on one or more rows
Posted by Ronald Hermans at 6/12/2006 3:40:01 PM
Hello all, I'm trying to figure out if a trigger (insert or update) works on 1 row at the time (where 2 rows where updated by a sql statement or alle the rows simultanious. Where getting the idea that all the rows at ones are processed. If so, how can we detirmen which row is which? TIA ...more >>

Reading Backup Schedule info for SQL 2K
Posted by Sydney Lotterby at 6/12/2006 3:04:36 PM
(SQL2K, WinAdvServer 2K, XP pro workstations) I have several sql dbs on backup schedules that were setup via EM. I need to be able to read these settings and also set new ones via a UI. Anyone know how to 'get at' this info? tia ...more >>

Date less then 13 months
Posted by Sehboo at 6/12/2006 2:29:51 PM
How can I use datediff function so that it returns me date with less then or equal to 13 months from today? thanks ...more >>

Transaction Logs
Posted by MS User at 6/12/2006 2:19:32 PM
Sql Server 2000 We have our 'DB Maintenance Job' schedule to run on weekend and it's enabled for 'Reorganize data and index pages. This process creates a huge Transaction Log which often cause issue to our Log Shipping process. Is there any method which can be done to 'reindex' tables o...more >>

Easy SQL query question
Posted by Ben at 6/12/2006 2:15:22 PM
Hi, I have a table (PartNumberTbl) includes all the part number. I want to add a part number 'ALL' in the following output so that user can select "ALL" in the DropDownList control: SELECT DISTINCT (PartNumber) FROM PartNumberTbl WHERE Customer = @Customer I don't want to create a Part N...more >>

log stored procedure execution
Posted by roxana.goidaci at 6/12/2006 2:13:03 PM
Hi, I need to find a solution to trigger / monitor stored procedure execution inside a given SQL Server 2000 database. I need to log into a separate table the stored procedures name and parameter values every time a (any) stored procedure is called, without having to alter the stored procedur...more >>

Outputting to a flat file
Posted by Big Ern at 6/12/2006 2:07:01 PM
I have created a stored procedure and need to send the results to a flat file, preferrably to a tab/spaced delimited excel file. Would anyone be able to help with this?...more >>

Enable SQL Server Remote Connections via Script
Posted by ramadu at 6/12/2006 1:53:02 PM
Hi, I am connecting to my SQL server 2005 database using a remote connection. Can someone provide me with a SQL script which will enable connections via TCP/IP to the database? (i.e. I'd like to do the step of going to the configuration manager and enabling the TCP/IP protocol for the SQL ...more >>

many as one to many
Posted by Daniel P. at 6/12/2006 1:36:02 PM
http://danutp.blogspot.com/ SQL Server - many as one to many Usually in a SQL database we can have two main associations between entities: one to many, many to many. In one of the recent projects I encountered a business need for a new concept. I call it "many to one-as-many". From dist...more >>

Input Parameter as Collection?
Posted by cider123 NO[at]SPAM hotmail.com at 6/12/2006 1:09:39 PM
The current stored procedure I have is: CREATE PROCEDURE pDeleteEmailLinks @EmailLinkID int AS DELETE FROM webEmailLinks WHERE EmailLinkID = @EmailLinkID GO This works fine, however I was wondering if it's possible to pass a collection to a Stored Procedure for processing? If so, how is...more >>

Get the column name of dynamical SQL?
Posted by nick at 6/12/2006 12:07:01 PM
I need to execute a lot of dynamical SQL (select only). These select statement have different column number and name. Any easy way to get the column names of a select statement string?...more >>

Service Broker Issue: User Connections Out Of Control
Posted by Ross Nornes at 6/12/2006 11:59:02 AM
I finally wrote my first service broker application and everything seemed great until the server crashed this weekend since it would not take on any new SQL connections. Details: PerfMon counter SQL General\User Connections shows 100 new connections being added every 10-20 minutes. sp_who o...more >>

ISNULL(check-expression, replace-expression)
Posted by Selvam Paramasivan at 6/12/2006 11:59:02 AM
Guys, My select query doest return the expected result set when replace-expression is null. Example SELECT .. WHERE ISNULL(@CUSIP, <<table fieldname>>) = <<table fieldname>> I have similar query which doesnt work if the field value is null. Otherwise it works fine. I know work around f...more >>

SQL Server 2005 - Deleting records
Posted by RM at 6/12/2006 11:34:48 AM
Hello all! I've gotten great ideas and advice here before so I'm back. Converting from access to sql 2005 takes a fair amount of importing records; testing programming code and reimporting records. It's a pain in the ___ to keep running code to delete the records imported into 2005 and re...more >>

using Case Statement inside Group By Clause?
Posted by Rich at 6/12/2006 11:28:02 AM
Hello, is it possible to run a query such with a case statement in the group by clause? DDL and sample data follow: Select os, count(*) as osCount From tblm Where os is not Null Group By Case When Left(os,3)='win' Then 'Windows OS' Else 'OtherOS' End This query gives me the error tha...more >>

Creating New Table & Linking to Datas
Posted by Selvarathinam at 6/12/2006 11:14:31 AM
Hi Everybody, I have a table as "AdjSummary" with 5 columns. I have to create a table with 2 columns from the above table. The structure of the table "AdjSummary" is as below INVNO ADJUST MODE PAYMENT MODE 10 100 OTH 0 NULL 11 ...more >>

Sending Website Notifications
Posted by Colette at 6/12/2006 11:12:02 AM
We have one primary mail profile set up on the SQL server to use for server notifications (xp_sendmail). We're now wanting send e-mail notificationss out using a "From" address that's different from the primary mail profile for a website. How can this be accomplished? I created another profil...more >>

How to use the return of select .... for xml auto...?
Posted by nick at 6/12/2006 11:06:01 AM
There is a lot of limitation on for xml clause. Is it possible to combine several select statement with for xml to a big xml file? Basically I want to implement something like: select ... for xml auto union all select ... for xml auto union all ..........more >>

TOP 10 Distinct statement
Posted by NeedHelpWith at 6/12/2006 10:51:41 AM
Hi all I am looking to select TOP 10 DISTINCT values from the db. I am getting a syntax error when i try SELECT TOP 10 DISTINCT (city) FROM properties What am i doing wrong here? Any pointers? Thanks Harry ...more >>

Auto Increment Starting 1 after deleting records
Posted by Asp Psa at 6/12/2006 10:36:22 AM
Hi, How can I make the auto increment number start from 1 again after deleting records in the table? I should have written it down somewhere when I knew it last year. Yontaek ...more >>

SmallDateTime- the mistery of the null data..
Posted by Pépê at 6/12/2006 10:33:57 AM
Hello, Im testing a form that inserts some data in a sql server express database. One of the fields is called Date and the type is smalldatetime. When i test the form locally and stores in the database that is locally too, the data is correctely inserted in the Data field. But when i tes...more >>

Crosstab Help in Sql Server
Posted by Justin at 6/12/2006 10:06:03 AM
I need some assistance, i have this Stored Procedure that will take my table and create a cross tab. Unfor, I am getting duplicate value from the output, when checking table1, there are no dups, i dont' know what i am doing wrong. Please help below, code that I am using. thaks ============...more >>

Trying to do a single to many join but only want the first record of the join.
Posted by UJ at 6/12/2006 9:54:52 AM
I have a table (a) with a value that is the key in another table (b). B can have multiple values for the found value. I want to return just the first one. So if A has 100 records and I do a join with B, I end up with only 100 records. Currently when I do a join I'm getting hundreds of records ...more >>

Lookup task problem in SSIS
Posted by Shiva at 6/12/2006 8:36:16 AM
Hi, I have Script Component in the Transformation phase that returns me values like NO, OTH, OWN (comma separated string coded value) Now I want to use the Lookup component (preferably or any other task really) to get the description by looking up a table in another d...more >>

Exists T-SQL
Posted by Joe K. at 6/12/2006 8:21:02 AM
I would like to change the t-sql statement listed below to execute quicker. Change the COUNT_CALL_MOVEMENTS_REC_0 data type from SMALLINT to BINARY. If a Pum value of 806478 is found within the last 60 minutes. The output COUNT_CALL_MOVEMENTS_REC_0 = 1, if not COUNT_CALL_MOVEMENTS_REC_0 =...more >>

List of SQL Server Proprietary Data Types?
Posted by Naveen at 6/12/2006 8:16:02 AM
Could someone point me to a list of SQL Server proprietary data types? Tried searching this forum and the web but couldn't find a full published list. Thanks. Naveen ...more >>

Problem calling an Assembly in SQL Server 2005
Posted by C at 6/12/2006 7:35:02 AM
Hi, I have created an Assembly as below CREATE ASSEMBLY ExampleYukon FROM '\\SomeLocation\ExampleYukon.dll' WITH PERMISSION_SET = SAFE When I call below I get "Msg 102, Level 15, State 1, Procedure MyProc, Line 2 Incorrect syntax near '.'" What is wrong with below?? CREATE PROCEDUR...more >>

Need Help on Query, Join or Union?
Posted by norrisinc at 6/12/2006 6:55:45 AM
I have two tables, project# Labor$ 123456 10025 789123 2052 and Project# Parts$ 123456 3569 456123 5698 and I am trying to get: Project Labor Parts 123456 10025 3569 789123 2052 456123 5698 I have tried ...more >>

Insert into 10000+ tables
Posted by Roar Nestegard at 6/12/2006 6:49:07 AM
Hi, I'm working on a product that collects information about thousands of objects on an interval, typically 5 minutes. Each object requires a separate table in the database. Recently we have experienced that the insert rate drops dramatically when the number of objects exceeds 10000. Th...more >>

INSERT Statement Question
Posted by schoultzy at 6/12/2006 6:48:11 AM
Hello everyone, I have a general question about INSERT statements. Is it possible to insert fields into a table both through a SELECT statement and explicitly in the same INSERT statement? For example, if I have the following part of an INSERT statement: INSERT INTO table1 (column1, colum...more >>

Questions for Taking Over SQL Support
Posted by Jerry at 6/12/2006 6:45:07 AM
The I.T. department I work for is going to start administering and supporting another department's SQL server database. I'm wondering what questions should we ask them to determine the level of support needed? Thanks for your input, -- Jerry ...more >>

timeout during backup
Posted by Ed White at 6/12/2006 6:31:03 AM
I had been successfully backup up my DB with commands in VB similar to the following: DB.ConnectionString = DbConnStr & "; Asynchronous Processing=True" Dim backupSQL As New SqlCommand("BACKUP DATABASE [DB] TO DISK='" & FileName & ".bak' WITH CHECKSUM", cn_DB) cn_DB.Open() backupSQL.ExecuteN...more >>

Crystal Reports Server XI: Logon to CMS
Posted by Daniel at 6/12/2006 5:21:10 AM
Hi group, Not sure if this should be posted here but anyway here we go: I just installed the trial of Crystal Reports Server XI, but now after the installation I had to register and after that it ask me to logon to the CMS. I need to fill in username + password and Authentication (Window...more >>

SQL Server 2005 - CREATE ASSEMBLY
Posted by C at 6/12/2006 4:52:01 AM
Hi, Wen I use the syntax CREATE ASSEMBLY on my local SQL Server as below... CREATE ASSEMBLY EntityStatus FROM 'C:\SomeDLL.dll' WITH PERMISSION_SET = SAFE ....I get "Line 1: Incorrect syntax near 'ASSEMBLY'." ASSEMBLY is not in blue in that it does'nt seem to recrognise the keyword. ...more >>

Concat Null Yields Null Woes..
Posted by hals_left at 6/12/2006 4:14:01 AM
I have a bunch of views that concat fileds, some of which allow nulls so I am using the isNull function when joining them. I dont want to have to do this, I want to set the database so that concat null does not yield null for all views and procedures. How do I do this this in EM ? I read and...more >>

What is the best connection ODBC/ADO or something else
Posted by rock at 6/12/2006 3:58:12 AM
Hi all, which is a best connection in VB/VBA to connect the remote SQL server. Regards, Shital ...more >>

Full-text on text-data and
Posted by Carl E at 6/12/2006 3:47:01 AM
Is this the right group for discussions on Free-Text issues? I see suggestions to mail to newsgroup “sqlserver.fulltext”, but I don’t find such a group. Anyhow: Working for a news agency, I’m building a news archive. Every article are stored in a SQL Server 2000 table on e.g. ID, Dat...more >>

Connection timeout/ODBC failed
Posted by rock at 6/12/2006 3:31:37 AM
Dear All, I am working on a VBA (MS Access) application, which connects Remote SQL Server by ODBC Connection. When I open this application on my workstation the error "Connection timeout' or "ODBC - failed" will occur, But when I open it on the remote desktop it will run. Can you suggest me...more >>

Replace Function? SQL2K/EM
Posted by hals_left at 6/12/2006 3:29:38 AM
Hi, I need to change some table and field names - is there a way to update all the occurances in Views and Stored procedures? ...more >>

dataset and xml problem
Posted by taleran58 NO[at]SPAM gmail.com at 6/12/2006 3:10:36 AM
Hello all, I'm tring to coordinate between a database and a my application throw a dataset object and a group of dataAdapters, one for each table. to display data, I use the xml driven from the method DataSet.WriteXml(). to store data I want to receive xml based on the dataset structure and let...more >>

Sql Server 2005 - Intellisense
Posted by S Chapman at 6/12/2006 2:48:49 AM
I have set Statement Completion\Auto List Members and Statement Completion\Parameter Information to true but still Intellisense does not work. Is there any other setting that I am missing? Thnks. ...more >>

Extended Property - Sql Server 2005
Posted by shailbpl NO[at]SPAM gmail.com at 6/12/2006 12:22:51 AM
Hello All, How would we use extended property in SQL Server 2005? Thanks Shail Shrivastava ...more >>

INvariant part inside SELECT
Posted by Just D at 6/12/2006 12:08:05 AM
All, Can we do this trick and if yes then how? Just schematically: the SP should return the number of records if the parameter @Count=1, if not, then the records themselves. The problem is that there is some complicated JOIN and the whole set of WHERE clauses that I wouldn't like to repeat ...more >>

Need help with report
Posted by News at 6/12/2006 12:07:02 AM
Hi, I have got this problem to solve and any help will be greatly appreciated. Here is approximate schema, it is simplified: create table tCompany (cID int NOT NULL PRIMARY KEY, cname varchar(20)) -- not relevant here but for general info, refers to companies create table tClass (clID...more >>

Conditional Column Filter
Posted by ricky at 6/12/2006 12:00:00 AM
Hi I have a field (FieldA) which I need to Filter on, based upon a parameter, however the filter is only a substring of the FieldA. e.g FieldA = H2/Q3/10 the filter supplied maybe supplied as Q3, H2,or 10, I how to split up FieldA in it's constituent parts, however in a WHERE clause I ...more >>

Joining date and time
Posted by Jozza at 6/12/2006 12:00:00 AM
Hi all, I need some help with joining two fields of type datetime, one with date relevancy and the other with time. If i join the integer part of date field with the fraction part of time field, the joined datetime is not the same. What's the trick here? TIA, Jozza ...more >>

Delay command execution
Posted by Adrian at 6/12/2006 12:00:00 AM
Hi Here is the setting: Clients connect to SQL Server 2000 via ADO. Here is the problem: After a client's successful login, the SQL Server 2000 should delay the processing of the client-commands by, e.g., 1 sec. How do I tell it to the SQL Server 2000? Thanks in advance. Adrian ...more >>

Dynamic WHERE clause
Posted by ricky at 6/12/2006 12:00:00 AM
Hi I have a WHERE clause, based on Params, passed in from a report, however, I cannot get it to work properly. I have to return two product codes, when a certain Types are passed in, however, when it's anything else, I am only to return one product type. Here's a sample of what I am tryin...more >>

Sql Log file
Posted by perspolis at 6/12/2006 12:00:00 AM
Hi all How can I view content of a sql database log file?? and How can I recover a database from a log file?? thanks in advance ...more >>


DevelopmentNow Blog