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 > september 2006 > threads for thursday september 14

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

sql injection question
Posted by Shahriar at 9/14/2006 9:30:04 PM
Could Textbox1.text or textbox2.text be hacked in anyway to allow for sql injection in the example below or is this as safe as it gets? Many thanks. Shahriar mysql = "select * from mytable where username=@username and password=@password" da.SelectCommand = New SqlCommand(...more >>


PICKLIST IN SQL
Posted by Ridhima Sood at 9/14/2006 9:13:02 PM
hi I am keen to know the sql command to display picklist values rather than unique numbers. for example, title is 1=mr and 2 = mrs if i say select title from contact sql returns 1 and 2 but i want it to return mr and mrs..any advice on this please...more >>

How to select a single varchar combined by many rows?
Posted by Cylix at 9/14/2006 8:09:06 PM
This question is quite common in my query, but I still have no idea about that. For example, My client have a number of companies, each company has its own phone number. Each phone number is store in row(not fixed number of row). Let say, there are 4 phone number (row) as 852 3745 3844 8...more >>

SQL problem to solve...
Posted by SammyBar at 9/14/2006 7:41:31 PM
Hi all, I'm facing the following problem. I should return the records from a table by using a store procedure. But each record should be repeated a number of time. The number of time the record should be repeated in the output is specified in a column in the table. For example, for the f...more >>

OPENROWSET
Posted by raidken NO[at]SPAM yahoo.com at 9/14/2006 6:48:39 PM
I have been struggling to run an OPENROWSET query against a SQL 2005 db. While attempting to query a SQL Server 2005 database from a SQL 2K database using OPENROWSET I set the following error: *******************************************************************************************************...more >>

passing a table from one sp to another sp
Posted by SQL Ken at 9/14/2006 5:49:35 PM
WHAT ARE THE OPTIONS do i have to pass a table from from one sp to another? write the data into a table and then use it from the other won't do the job for me. thanks ken ...more >>

done in a single statement
Posted by Thom Anderson at 9/14/2006 5:46:00 PM
A table looks like this: create table #customer ( customerID int not null primary key, taxID char(9) not null, salesRep int null) insert #customer values (1, '111111111', 5) insert #customer values (2, '111111111', null) insert #customer values (3, '111111112', 7) insert #customer values (4, '...more >>

How to utilize the rowId in sql server
Posted by SQL Ken at 9/14/2006 5:33:10 PM
I know that each record in a table has an id internally. Can someoneshow me how to utilize it? thanks ken ...more >>



Temp Table Indexing??
Posted by Dan at 9/14/2006 5:07:01 PM
I have a stored procedure that does heavy query to get a dataset. That dataset is then used in several other queries and joined to other physical tables in the database. When I use a temp table to store the dataset, it is very slow when joining in the subsequent queries. I have determined that...more >>

Query help
Posted by Ami at 9/14/2006 5:03:35 PM
Hi All I need a query help. How to display the record(only record) that has maximum occurrence of a particular value in a column? Say, I have a Table called Table1 with columns Col1, Col2, Col3 and Col4 and Col5. I want to display the record details that occurs maximum number of times, w...more >>

Need help with self-join
Posted by Terri at 9/14/2006 3:50:48 PM
I am using a self-join to add amounts with different dates in the same table. CREATE TABLE #Testdata ( Account char(1), AmountDate datetime, Amount int ) INSERT INTO #Testdata (Account, AmountDate, Amount) VALUES ('A', '20060801',5) INSERT INTO #Testdata (Account, AmountDate, Amount) V...more >>

Shipping 2
Posted by CLM at 9/14/2006 3:42:02 PM
"[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 4306: [Microsoft][ODBC SQL Server Driver][SQL Server]The preceding restore operation did not specify WITH NORECOVERY or WITH STANDBY. Restart the restore sequence, specifying WITH NORECOVERY or WITH STANDBY for all but the final step. [Microso...more >>

training
Posted by Richard Douglass at 9/14/2006 3:31:41 PM
I am looking for a really good set of training CDs for SQL 2005. I dont want a set that teaches me how to pass the MCDBA tests. I want a set that teaches me tips and tricks and the how-to's of real programming with the 2005 model. Any ideas? Thanks Richard ...more >>

data disappearing in a trigger
Posted by rengeek33 at 9/14/2006 3:09:02 PM
I have a table that has a trigger that loads data into other tables. When I run records into this table, there is one field in particular that sometimes loads and sometimes does not (@DstIndx ). It is a strange aberration because the same value in two different records may get loaded for one...more >>

xp_cmdshell - works with string in one format but not in another -
Posted by smaas NO[at]SPAM newsgroups.nospam at 9/14/2006 2:06:01 PM
We are using xp_cmdshell in a trigger to call a VB program and pass to it required parameters. The call with the parameters in the desired structure is below (code stripped down to bare essentials): declare @sDirectory varchar(200), @sBartender varchar(200), @sOutput varchar(200), @sFormat...more >>

Are operations in a stored procedure treated as a transaction
Posted by betbubble NO[at]SPAM gmail.com at 9/14/2006 1:56:17 PM
I need help on two questions: 1. Is temp table the only way to pass recordsets from a nested stored procedure to a calling stored procedure? Can we avoid temp tables in this case? 2. Are operations in a stored procedure treated as a transaction? Any help will be greatly appreciated. Backgr...more >>

Problem with repeated use of temp tables
Posted by Dmitriy Antonov at 9/14/2006 1:26:44 PM
Hello all, Following is a sample script for sp: Create Procedure spTest @Flag Bit As If @Flag=0 Begin Select * Into #tmp From tblTable1 End Else Begin Select * Into #tmp From tblTable2 End Select * From #tmp Drop Table #tmp GO This scri...more >>

How best to create a unique identifier across two or more tables...
Posted by Jesse Aufiero at 9/14/2006 1:10:37 PM
I have a table that has an ID column set as an int type with identity set to 'Yes', so that each number that is auto-generated in this column will be unique. However, now I need to add a second table to the database which will also need an ID column. My problem is that I have a requirement t...more >>

getting sa password
Posted by rodchar at 9/14/2006 1:05:02 PM
hey all, how do i get/set password for sql express? thanks, rodchar...more >>

SSIS and SLowly Changing DImension Transform
Posted by alexde at 9/14/2006 1:04:02 PM
Any simple example on internet to get started with SSIS slowly changing dimension object? I am getting an error and can't find any info on resolution: there must be at least one column of fixed, changing or historical type of input for slowly changing dimension transform. help appreciated...more >>

SQL query
Posted by BK-Chicago at 9/14/2006 1:04:01 PM
Hi I would like help with the following query. The table: CREATE TABLE [dbo].[MyTable] ( [ID] [char] (5) AS NOT NULL , [period_date] [datetime] NOT NULL , [value] [numeric](18, 6) NULL ) ON [PRIMARY] Sample Data: 0004N 9/30/1989 67.309 ...more >>

Update Statement
Posted by Anonymous at 9/14/2006 12:28:02 PM
I have 2 tables in SQL Server 2000. Table1: ID Field1 Field2 Field3 111 Table2: ID Field Code 111 blue 1 111 red 2 111 yellow 3 I need to update Field1, Field2, and Field3 in table1 as follows joining on...more >>

Date Range
Posted by wnfisba at 9/14/2006 12:27:02 PM
Why would the following SQL return different rows??? SELECT CQTLOAN.LOAN_NUMBER, CQTLOAN.LOAN_CREATED_DATE FROM CQDS50.dbo.CQT_LOAN CQTLOAN WHERE MONTH(CQTLOAN.LOAN_CREATED_DATE) = '06' --WHERE CQTLOAN.LOAN_CREATED_DATE BETWEEN '06/01/2006' AND '06/30/2006' ORDER BY CQTLOAN.LOAN_CREATED_DA...more >>

Ship
Posted by CLM at 9/14/2006 12:06:02 PM
I have almost got log shipping working (SS 2000) but have one last issue to go. First of all, all jobs that log shipping set up on my primary server are working. And on the secondary server all jobs are working except for the "Log Shipping Restore for PrimaryServer" but doesn't give any usef...more >>

Case-sensitivity and LIKE - not working in 2000?
Posted by Paschott at 9/14/2006 11:43:36 AM
Ultimate goal - find all addresses that are either all lowercase or all uppercase. Running SQL 2000, hotfix level between SP3 and SP4. Created a new table of address data that is case-sensitive. CREATE TABLE Address (Address_ID int , House_ID int , Address_1 varchar(50) NOT NULL COLLATE...more >>

OpenrowSet querry
Posted by SQL Ken at 9/14/2006 10:55:38 AM
what is wrong with my code here? I need to query from a remote sql server. thanks SELECT * FROM OPENROWSET('SQLOLEDB', '192.132.88.30'; 'loginName';'Password', 'SELECT * FROM MyDataBase.dbo.Mytable') ...more >>

UDF Permissions
Posted by Joshua Andrews at 9/14/2006 10:44:22 AM
I know that a user must have permissions to call a UDF directly, just like they must have permissions to EXEC a stored procedure. However, if a UDF is called from within a stored procedure, and the user has permissions to the SP, does the user also need direct permissions to the UDF as well...more >>

large result sets
Posted by Noble Shore at 9/14/2006 10:18:01 AM
I need to return all rows from a table with 50K+ records. The computer that runs this program does not have sufficient resources to run such a large query, although it runs fine with 5K or 10K results. I know about "SELECT TOP <N> * from <TBL>" but is there a way to start from a row index othe...more >>

Win Server 2003 SP2 - SQL2k5 Performance Improvements
Posted by tcs at 9/14/2006 9:52:02 AM
I have read that there will be SQL Server 2005 performance improvements in SP2 for Windows 2003. Does anyone know the specifics on what will be improved? Thanks ...more >>

Date Query
Posted by FARRUKH at 9/14/2006 9:41:02 AM
i am trying to run the query tht only brings the date. In our database we have a date record like that (1999-05-18 00:00:00.000) Is there any way I run query and only bring date(1999-05-18) not time (00:00:00.000)? thanks Farrukh ...more >>

Small problem with NOT EXISTS...
Posted by kollatjorva NO[at]SPAM gmail.com at 9/14/2006 9:23:43 AM
Hi all I have this table guid datecreated account dateremoved 5DC40536 1.8.2006 9574DAAD 30.8.2006 A89B5B69 17.7.2006 FD20B38C 17.7.2006 2B9FD838 30.5.2006 BEB49691 14.9.2006 6C2B8DFA 17.7.2006 FD20B38C 17.7.2006 C0BAB1A4 17.7.2006 FD20B38C ...more >>

Resetting Identity/Auto-increment Seed
Posted by Micus at 9/14/2006 8:26:08 AM
[VS 2005 Pro, SQL 2000] Hi all, I've been using an SQL 2000 database for testing/debugging code. The code is ready for the real world however I would like to purge all content from the database and reset it to a 'new' state. Specifically, a few tables contain an auto-increment (Iden...more >>

Linked Server Error: Login failed for user NT AUTHORITY\ANONYMOUS LOGON
Posted by Jay at 9/14/2006 8:24:45 AM
I have a SQL 2000 instance and a SQL 2005 instance on a 32bit Win 2003 Servers. Both systems are using the same user id & password. Both instances use windows authentication mode. In the SQL Server Enterprise Manager on the SQL 2005 instance I created a linked server to the SQL 200...more >>

Statistic Problem
Posted by tho at 9/14/2006 7:30:52 AM
Hi all, I'm searching for a simple sql statistic solution. I have 2 tables: 1st table: website-visits | department ---------------------------------- 5 | A&B CD Z1 30 | A&B AD Z0 4 | B&B X1 2nd table: customer | department-searchstring --------------------------------...more >>

Simple SQL query for counts and Sum
Posted by Pauljh at 9/14/2006 7:19:14 AM
Hi All, As all the comp.database groups seam to be available for read only (and not post) I'm posting my question here, hopefully someone much better at SQL can help (which isn't saying much my SQL knowledge is rather limited). Anyway I have a table which has the properties Allocati...more >>

Operator on a table that has UDTs and returns a table of UDTs
Posted by Andy in S. Jersey at 9/14/2006 6:47:02 AM
This post continues much of the work done in the thread: Subject: UDF that takes a UDT as a parameter (CLR) (Kent has been very helpful) but is a little different I have created a UDT that essentially represents an interval between two integers. (the code for the UDT can be found at the...more >>

Time recording query
Posted by dotnet dude at 9/14/2006 6:07:28 AM
Here is an interesting problem: Lets say I own some imaginary company. Like for all companies, my employees report their time to some time reporting application. Following table stores these time recording activities: EmpId Date Project No_of_hours 1 08/01 P1 ...more >>

SSIS package for adwentureWorksDW database
Posted by avicentic NO[at]SPAM gmail.com at 9/14/2006 5:57:46 AM
Is Microsoft published example of SSIS package (or packages) for making adwentureWorksDW database from AdwentureWorks db? Where can I find it? Thanks ...more >>

Aggregate columns in a UNION
Posted by Leif S at 9/14/2006 5:07:02 AM
In a sp I aggregate values in a union: SELECT O.operations_code, SUM(ISNULL(OL.operations_duration, 0)) AS Accum FROM dbo.dpr_report R INNER JOIN dbo.dpr_operations_report_line OL ON R.dpr_report_id = OL.dpr_report_id RIGHT OUTER JOIN dbo.vessel_operations_code O ON OL.operations_code_id =...more >>

Transfer Data From One Database to another Database
Posted by Lalit at 9/14/2006 4:18:02 AM
Hi Friends, I have to transfer data from one database to another and some of tabels in both the databases are different in no. of columns and some new tables are added. Some tables are having 1,000,000 records. I have written INSERT INTO SELECT queries. for the tables having 1,000,000 ...more >>

get autogenerated id after insert
Posted by Sam Jost at 9/14/2006 3:30:16 AM
I got a table created something like this: CREATE TABLE dbo.MyTable ( [ID] uniqueidentifier NOT NULL ROWGUIDCOL CONSTRAINT [PK_MyTable] PRIMARY KEY, [...] ) ON [PRIMARY] ALTER TABLE dbo.MyTable ADD CONSTRAINT [DF_MyTable_ID] DEFAULT (newid()) FOR [ID] Now I INSERT a new row, a...more >>

Help with query...
Posted by New to SQL at 9/14/2006 3:09:48 AM
My table is defined as TABLE PERSON id, int Name varchar(500) Table PlacesOfTravel Personid(fk from table PERSON) Place sample data for PERSON 1 Manmohan singh 2 Sonia Gandhi sample data for PlacesOfTravel 1 New Delhi 1 New York 1 Bangalore 1 Hyderabad 1 Chennai 2 New Delhi 2 ...more >>

sorting problem
Posted by aidanc at 9/14/2006 1:19:17 AM
I'm trying to write a query to sort a table by a column containing both numerical and alphabetical values. The values are stored as strings. The problem is that I need to sort numerical values numerically and sort anything with alphabetical characters in it alphabetically. For instance the col...more >>

UNDO
Posted by catsailor at 9/14/2006 12:00:00 AM
Greetings, I am looking for a way to implement UNDO in my database apps. We have several SQL 2005 Standard Ed and SQL Everywhere database apps. Some are connected to web forms and a few others connect to Windows forms. What I would like to do is give users a command to UNDO some number of ...more >>

XP_SENDMAIL Overload in SQL 2005
Posted by Dr. Network at 9/14/2006 12:00:00 AM
Not sure whether this is a setup or a programming issue. I tried setup and got no response. I'll try programming. In SQL 2000, I could drop system extended stored procedures without any problem and replace them with my own extended stored procedures or stored procedures with the same name. On...more >>

how to do this
Posted by L.Peter at 9/14/2006 12:00:00 AM
Hi Group, I have been struggling this case for two days but still could not proceduce the desired result. I have student table: studentid studentname 001 student 1 002 student 2 003 student 3 subject: subid name presub postsub 02en english 03en e...more >>

Query help.... with CASE
Posted by DL account at 9/14/2006 12:00:00 AM
--DDL create table systems ( sysid int primary key, sysnme varchar(30) not null, sysuser varchar(40) null, ) create table software ( swid int primary key, sysid int references systems(sysid), cmpny varchar(30), prod varchar(30) ) go --Data inserts insert systems values(1,'sys1','us...more >>

Union with the results of two SP
Posted by Robert Bravery at 9/14/2006 12:00:00 AM
Hi all, I've been asked the question of one can peform a union with the results of two or more SP's Thanks Robert ...more >>

Converting Rows into columns
Posted by Ram at 9/14/2006 12:00:00 AM
Hai, I want to convert from rows to columns. I have a table like this. col0 Day Task ----- ----- ------- 1 Mon Office 1 Mon work 1 Mon Client 2 Tue Office 2 Tue Client 2 Tue Holiday 3 Wed Tour I want out...more >>


DevelopmentNow Blog