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
August 2008


all groups > sql server programming > january 2007 > threads for wednesday january 17

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

How to get a where clause with dates between specific months?
Posted by zwieback89 via SQLMonster.com at 1/17/2007 11:47:37 PM
Hi, I would like to query a table - OrgStructure where I would like to see the dates from June 2005 to May 2006. I do not care about the starting day within the month of June and the ending day of May, 2006 as long as it includes all the dates within the time frame of June 2005 to May 2006. ...more >>

Can this be done?
Posted by Ant at 1/17/2007 11:21:02 PM
Hi, I want a SELECT statement to return a value to a case statement. Can this be done? Is there simply an error in my script? If it can't be done, how would I do this? I'm getting an error around the closing bracket of the Case statment. Thanks in advance for any ideas on this. Below is...more >>

Padding an interget with '0' to produce a leading zero string
Posted by Robert Bravery at 1/17/2007 10:39:02 PM
HI all, How can I pad a int number to produce a char with leading '0' Say I have a number 31, I want to produce '0000031' THanks Robert ...more >>

how to disable database cache for large result set
Posted by light_wt at 1/17/2007 10:27:02 PM
Hi, I have a request to fetch the half of the table over network. The table has about 1 million rows (400 MB). Is there a way I can write a stored procedure, so, the large result set won't "reside" in the RAM and just shoot directly via the pipe? My concern is the large result set wil...more >>

use in then get array string from table
Posted by Ganesh at 1/17/2007 10:04:16 PM
Hi There, How can i find the description of audit table contains any emplyee_id in it like this below. Select * from Audit where desc like (Select employee_id from employee) Select * from Audit where desc in (Select employee_id from employee) Thanks ...more >>

Design question - Single table with many relationships
Posted by Naveen at 1/17/2007 8:56:00 PM
We are in the process of building a pretty large database. It encompasses several functional modules, like Accounts Payable, General Ledger etc. The decision has been made, to go with a single database instead of one database per functional module. How do I deal with the following scenario, wh...more >>

selecting records #20 - #30 from recordset of 100
Posted by brendan.wong NO[at]SPAM gmail.com at 1/17/2007 8:48:12 PM
hello. i have a recordset of size 100. but, what i want to do is select 10 records at a time, starting with 1-10, then 11-20, then 21-30, etc. i'm trying to break it down into smaller chunks so that if a user, for example, clicks on page 2 of my website, he only gets records 11-20. does anyo...more >>

The GO statement and full recovery
Posted by Derek at 1/17/2007 8:32:45 PM
i have a script that deletes 2000 rows from my database. does it matter if i have a GO after each delete or should i just have one for all 2000. my database is under full recovery. i'm guessing it does not matter from a transaction log standpoint since all the entries will be recorded anyway...more >>



Defining Alert for System Errors
Posted by Leila at 1/17/2007 8:15:04 PM
Hi, I want to define alert for system error messages but it seems that we cannot alter these messages like SQL Server 2000 to be logged in Windows events. For example error #208, is it possible? Thanks in advance, Leila ...more >>

How to query info from a second table for multiple IDs in the first table?
Posted by mrroboto at 1/17/2007 6:33:54 PM
I have 2 tables (Match and Team). Match - Table 1 MatchID int Team1ID int Team2ID int Team3ID int Team - Table 2 TeamID TeamName Description I would like to query the Match table and join to the Team table to return team details for a given match. So I would like to see the follow...more >>

Collation Problem 2
Posted by J NO[at]SPAM Work at 1/17/2007 6:12:17 PM
Hello, I would like to program in ASP with connecting a remote MSSQL. However the regional options (Location and Language) are different from the two servers. How can I ensure the non-English can be displayed correctly? Thanks a lot. J > "J@Work" <licp@hotmail.com> wrote in message > ...more >>

Update Query Help Needed for SQL Server 2000 - URGENT
Posted by Sean at 1/17/2007 4:55:01 PM
I need to update ACTINDX in TABLE2 for each JOBTITLE in TABLE3; please help. Thanks TABLE1 ACTINDX ACTNUM_1 ACTNUM_2 ACTNUM3 ACTNUM_4 ACTNUM_5 30562 222 411001 000000 150 350 30563 222 411001 000000 155 355 TABLE2 JOBTITLE ACTINDX 209401 ...more >>

physical location of file
Posted by Jon Paal at 1/17/2007 3:23:40 PM
how can I get the physical location of the database file from sql server manager ...more >>

creating table with Create Table
Posted by Roy Goldhammer at 1/17/2007 3:16:11 PM
Hello there I have huge table with 1,500,000 records When i use Create Table to create temp table based on the huge table with only 6 records of 12 and insert all the data it takes at least 12 seconds And when i use Select () into statement it takes 3 seconds on the execution plan the ...more >>

18452 error on sql2005
Posted by perspolis at 1/17/2007 1:31:37 PM
Hi all I used Windows Authentication mode in sql2005.and I also add my users in logins.. but when I try to connect to sql2005 from another pc it gives me error 18452.. I did the same for sql2000 but it works well. ?? I also use SqlServer Authentication mode and it works well too.. thank...more >>

I know this must be a simple query ...
Posted by Arnie at 1/17/2007 1:10:27 PM
.... I just can't quite get the syntax correct. Consider master/detail tables, M and D. M has a unique column named "Name". It is the FK into the detail table, where it is not unique. What I want is a result set that has M.Name and the count of detail records associated with that name, eg...more >>

Collation Problem
Posted by J NO[at]SPAM Work at 1/17/2007 1:00:53 PM
Hello, I've a MSSQL 2000 server with program scripting in ASP (at another server). I have a problem that some data in the database is non-English and I find that those non-English characters cannot be retrieved well. I would like to know if any programming or database configuration may help...more >>

sql print color
Posted by dcinadr NO[at]SPAM gmail.com at 1/17/2007 11:57:47 AM
is there a way to print the output in a specific color when calling the "print" command in sql? For example if was to call "print 'Something' " in query analyzer can i make it print out in a specific color? ...more >>

Help with Update Script..
Posted by trint at 1/17/2007 11:54:41 AM
I need to sort this table like this: SELECT * FROM custom_carts ORDER BY position ASC This will list about four results, but I just need the first record found. Then find this item: select * from archive where name = 'Custom Carts' and then copy two fields from the FIRST item fou...more >>

Create Relation Cross-Tab from Flat Table?
Posted by xeroxero at 1/17/2007 11:38:51 AM
Set NoCount On If Exists ( Select Name From TempDb..SysObjects Where Id=Object_Id('tempdb..#Blocks') and Xtype = 'u' ) Begin Drop Table #Blocks End Create Table #Blocks ( Block VarChar(6) , ParentBlock VarChar(6) ) Insert Into #Blocks( Block , ParentBlock ) Values ( 'aaa' , '111' ) Insert In...more >>

How can i use a "Table" variable in a dynamic sql query?
Posted by Burak Gunay at 1/17/2007 11:25:58 AM
Hi, this is what i have in my stored procedure declare @SQL varchar(6000) declare @TableVar table ( ID int IDENTITY PRIMARY KEY, Crs_Id int ) set @SQL = 'INSERT INTO @TableVar(Crs_ID) values(2)' exec(@SQL) when i run this, i get a "Must declare the variable '@TableVar'." er...more >>

Scheduling stored procedures
Posted by bj at 1/17/2007 9:56:52 AM
I've written a stored procedure on my SQL server that deletes records older than 7 days from a table. My SQL server the procedure resides on a shared hosted environment. I now want to schedule the procedure daily, which i attempt to setup through the enterprise manager tools menu. As i ...more >>

Production Database
Posted by m at 1/17/2007 9:21:32 AM
Hi All I have SQLServer 2005. Is there a security issue if webapp talks directly to production database. Is there any approach where you can have webapp talks to some copy of production database and this gets sync with production database. Please let me how you deal with this kind of sit...more >>

HELP!!!!! - reading XML data out of sql2005
Posted by esebastian NO[at]SPAM esolutionsgroup.ca at 1/17/2007 9:06:15 AM
Hello All, probably a very simple solution to this but i am having a problem. I have 2 tables that contain data, the second table joins to the first table, neither of these tables contains XML however i have created a select statement that returns the data i want in XML format. This works fine ...more >>

Sort order and view
Posted by Robert Bravery at 1/17/2007 7:49:43 AM
HI all, Using SQL 2005, I create a simple view Select * from employee order by name But when I select the view with select * from employeeview the sort order is not adheered to. I have to specificcally issue a order by on the view Can someone explain this to me Thanks Robert ...more >>

How to get ALTER scripts of all SPs in a DB
Posted by Shocky at 1/17/2007 6:53:17 AM
I want to take the alter scripts of all SPs in a DB (in separate files). How do i do this? I am using SQL Server 2005. ...more >>

MCQ Questions
Posted by Adnan at 1/17/2007 6:43:55 AM
Hi, I an new to this group. I think this group will be helpful to me. I have to appear in the test of database. can any one help me by providing the Multiple chocie question with answer about the databases or sql server. ...more >>

sql query needed to 'merge' rows (not easy.. been trying a couple days)
Posted by nemo at 1/17/2007 4:56:57 AM
I have a database with 4 relevant tables of information. table1 - inventory list of all computer assets along with userID. The userID is not always populated. table2 - a list of users and their cost codes. (not all users will be in list, just those with cost codes) table3 - a list of asse...more >>

Help me before i get mad SQL Query
Posted by althafexcel NO[at]SPAM gmail.com at 1/17/2007 2:17:35 AM
I'm a new bie to SQL. Getting crazy with a query. I posted 3 times and couldn't grasp the help as i can't understand clearly. All what i need is to query the dates based on the below data. The datatype of StartDate and EndDate is Datetime and just when you query the output is shown as below. ...more >>

Strange problem: Warning: Null value is eliminated by an aggregate or other SET operation.
Posted by autotest100 NO[at]SPAM hotmail.com at 1/17/2007 2:17:25 AM
Hi I would lile to run the following query: ################################################################################### select B.FI, B.DI, B.KLNR, B.YEAR, SUM(B.COUNTVIS) , SUM(B1.COUNTVIS) as BC1 , SUM(B2.COUNTVIS) as BC2 , SUM(B3.COUNTVIS) as BC3 , SUM(B4.COUNTVIS) as BC4 ,...more >>


DevelopmentNow Blog