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 > october 2007 > threads for tuesday october 16

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 31

return string
Posted by j at 10/16/2007 11:07:18 PM
Hello, I am trying to query a database and return the information in a zpl (zebra printer language) string. I know the query and I know what the string needs to be but and having problems. Here's the goods (or in my case the bads): DECLARE @vchBrand varchar(20) DECLARE @vchFlav varchar(2...more >>


Selecting rows limited to the last year(in MS Excel SQL)
Posted by Canuck at 10/16/2007 10:51:02 PM
I apologise if I have selected the wrong group, and if I have please let me know as I am a newbie to this. I have put together the following SQL code in MS acess: SELECT T1.INTERVAL_START_DATETIME, T1.QTY, T1.S_PRICE, T1.Q)CLEARED, T1.M_Price FROM DATASOURCE.T1 T1 WHER...more >>

return string
Posted by j at 10/16/2007 10:15:41 PM
--I tried to submit this 20 minutes ago and cannot see it yet. I hope it is not a dupe. Hello, I am trying to query a database and return the information in a zpl (zebra printer language) string. I know the query and I know what the string needs to be but and having problems. Here's the ...more >>

stopping a insert statement witha trigger or setting unique?
Posted by Lord Kelvan at 10/16/2007 9:53:18 PM
ok i have an interface beign built and a requirement of this interface is to have a table that records tasks people do a requirement of these tasks that are stored in the database is that the name of the task must be unique each task is releated to a project so a project has many tasks but the u...more >>

logon trigger causing deadlock
Posted by nj at 10/16/2007 8:48:52 PM
Hi All, Sql Server 2005 SP2 I enabled logon triggers on server. Please see script for logon trigger below. Now i am seeing deadlock errors in error log. I enabled traceflag 1222 on server and can see all the deadlock events in error log. As per my interpretation all the deadlocks are ...more >>

Slow UNION ALL
Posted by Axel at 10/16/2007 7:59:07 PM
Hi, can anybody give me some ideas why a UNION ALL would significantly slow down running 2 views? I am working on this for a couple of days now and I am running out of ideas. I have looked at the execution plans of the individual views and the major work seems to be done clustered index scan...more >>

How to populate a treeview from a dataset
Posted by xmail123 NO[at]SPAM yahoo.com at 10/16/2007 7:57:58 PM
I am very new to C#. I need to create a Windows form that will read a SQL table and populate a treeview. I can connect to the DB, create the dataadapter, populate a data set. The problem is how to use the dataset to populate a treeview. I have looked at a few examples but none use a datas...more >>

Query not exit record through the char values
Posted by huohaodian NO[at]SPAM gmail.com at 10/16/2007 7:06:06 PM
Hi I have two tables, one temporary inserted from a bulk insert with over 100000 user records, another one used by main application that also has over 100000 records, the cross reference fields between two tables are fields called RefKey which is a the field with char value, since there are ...more >>



UNION With Sort
Posted by IfThenElse at 10/16/2007 3:19:08 PM
Hi, up front I know that I can not use Order by in a subquery with UNION, is there a wok around? need to get last item, something like: Select top 1 myItems from etc... where xyz = 'idjnwlsl' order by myItemsID desc UNION Select top 1 myItems from etc... where xy...more >>

Table Usage Script
Posted by Dragon at 10/16/2007 1:56:04 PM
Hi, I am trying to find a script that can go through a given database and show you the following: Tables with 80+ % reads and 20-% writes Tables with 50/50+- Read/Writes Tables with 80+% writes and 20-% reads. Essentially I want to run my index defrags/rebuild on all these tables ...more >>

Weird date compare problem
Posted by doofy at 10/16/2007 1:55:35 PM
I've got a query that I want to pull back all records before the end of the month, whatever month I choose. Here is the pertinent part: WHERE (dbo.COM_TAP_ACCOUNT_CONTRACT_HISTORY.ACTIVITY_ON < DATEADD(day, 1, @end_date)) I'm plugging in variables of 8/31/07 for the @end_date, and I eve...more >>

sloow UNION ALL
Posted by Axel at 10/16/2007 1:43:21 PM
Hi, can anybody give me some ideas why a UNION ALL would significantly slow down running 2 views? I am working on this for a couple of days now and I am running out of ideas. I have looked at the execution plans of the individual views and the major work seems to be done clustered index scans...more >>

FK - Can I do this?
Posted by shapper at 10/16/2007 12:12:11 PM
Hello, I have 3 tables: [A] > Aid (PK) [B] > BId (PK) [C] > CId (PK), TargetId (FK) TargetId should be related to both Aid and Bid. Can I do this? Records created in C can be related to records in A or in B and TargetId can be either a Aid or Bid? Thanks, Miguel ...more >>

unnecessary evaluations
Posted by John A Grandy at 10/16/2007 11:34:03 AM
Does t-sql evaluate the right side of an OR if the left side is true ? For example : ( Employees.StartDateTime IS NULL ) OR ( Employees.StartDateTime > CAST('1/1/2007' AS DATETIME) ...more >>

stored procedure times out after 10 minutes
Posted by vb4me at 10/16/2007 10:41:59 AM
Hello. Can anyone help with this one? I've written an app that queries data on two linked servers (sql server 2000). The stored procedure runs fine when I 'exec' it in management studio, but it times out when launched from VB2005. The funny thing is it worked last week - I'm just not sure wh...more >>

2005 Express and the Client Tools
Posted by CLM at 10/16/2007 10:04:04 AM
Our shop is all SS 2000 SP4. But I need to study for the new MCITP exam for Sql Server 2005. On my work computer I have both the 2000 and 2005 client tools. So I've got the client tools to help me study for the exam. But how can get an actual 2005 server on my work computer to help study f...more >>

Data modelling - normalising dependant fields NOT-NULL/NULL
Posted by microdevsolutions NO[at]SPAM yahoo.com.au at 10/16/2007 9:54:25 AM
Hello, I have a data modelling question. I have a table called tblTransaction with a primary key (identity field) of TransactionId. On this table I have two fields AssetClassCode and AssetCode thus :- TransactionId: 1 AssetClassCode: A AssetCode: MMM TransactionId: 2 AssetClassCode: A...more >>

linked server insert statement over many records gradually slowing and filling up memory
Posted by nosliwmada NO[at]SPAM gmail.com at 10/16/2007 9:19:16 AM
I've been scouring google and google groups for help with my problem but haven't found it. I'm hoping that you can help me. I have a SQL Server 2000, SP4 with a linked server pointing to a SQL Server 2005 (most recent SP). On the SQL Server 2005 I have a table called "note": CREATE TABLE [...more >>

Primary key question
Posted by Jim Reynolds at 10/16/2007 9:00:05 AM
Hi, I have been asked to creata a table in SQL 2000 Db with an auto generating primary key field which comprises of Date, Time and a unique random number. Could anyone please tell me which is the correct way to achieve this? Many thanks Jim...more >>

Contents of C drive
Posted by zomer at 10/16/2007 8:28:43 AM
how can i view contents of c drive in SQL Server 2005. Is there a extended sp that i can use similar to xp_fixeddrive that gives free space on server drives? thanks. ...more >>

Unique IDs issue
Posted by bradsalmon at 10/16/2007 7:58:26 AM
Hi all, I'm new to sql programming but guessing that this is an old issue so looking for some advice please. I have a table setup as follows - MyTable id (varchar(16)) person_id (varchar(16)) network_id (varchar(16)) network_code (varchar(16)) Now I want to replicate a set of codes ...more >>

freetexttable bug
Posted by surigaonon at 10/16/2007 7:33:02 AM
Hi, We've been using the catalog as part of our search engine for a year now. We use freetexttable to search for keywords and it is fine until now. For some reason the 'freetexttable' is inconsistent. I tried this query and I got a lot of rows. select * from tb_catalog where conten...more >>

is it possible to do this in one query?
Posted by Derek at 10/16/2007 7:21:27 AM
sql 2000 i want to create a flattened out association table that looks something like this anscestorid descendentid 1 2 1 3 1 4 1 5 3 4 3 5 4 5 here is the current table i want to flatten out create t...more >>

How to Alter Database Settings
Posted by lcerni at 10/16/2007 6:16:03 AM
I have tested with this: --======================================================== SET ANSI_NULLS ON --740 rows select * from client where client_addr_2 IS NULL --0 rows select * from client where client_addr_2=NULL --0 rows select * from client where client_addr_2 <> NULL --========...more >>

Sorting strings with single quote 2000 vs. 2005
Posted by KWC at 10/16/2007 3:46:05 AM
Does anyone know why SQL 2000 sorts the two strings: CONCEPT 5% CONCEPT 'A' 1. CONCEPT 5% 2. CONCEPT 'A' while SQL 2005 does the reverse? Both servers and databases are set to SQL_Latin1_General_CP1_CI_AS. Possible bug? Thanks Kelly...more >>

generate random weekly menu
Posted by crazyfisher at 10/16/2007 3:16:01 AM
Dear all, I am design a sql database which can generate random weeekly menu from the recipes available in the database table,should I use newid() to do that? for example, to randomly return 7 dinner recipes and 7 deserts recipes from the recipe tables? thanks !!!...more >>

Simple problem but the query takes too long
Posted by franzitaly at 10/16/2007 1:38:13 AM
Hi Group, I need to solve a probles with a queiry that is quite simple really, but because of the large (not THAT large though) number of rows it just takes too long to execute. The platform is SQL Server 2000 and I need this query to run in 10-20 seconds...if possible... So here is the pro...more >>

login remove MUST_CHANGE selection
Posted by khaled at 10/16/2007 12:00:00 AM
Hi how to remove the option of password MUST_CHANGE , after the creation login ? is there and syn. can be used with alter login ? Thanks. Khaled ...more >>

How to log schema changes in SQL2005
Posted by Slawomir Zurek at 10/16/2007 12:00:00 AM
Hello, I nedd to log schema changes (automatically, without user interaction) on all objects in database. The best solution would be posibility to auto save script like generated via "Generate change script" button from SQL Server Management Console. I was investigating DDL triggers, but ...more >>

Getting same results with NewID() Union
Posted by harry.kitten NO[at]SPAM gmail.com at 10/16/2007 12:00:00 AM
I created a really simple table from which I want to return 9 random records, 3 where a flag is true, 6 where it's not. I've tried to do this with a UNION but I get virtually the same records each time. It never returns results where the ID is greater than 12; yet when I run these queries separa...more >>


DevelopmentNow Blog