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 > november 2005 > threads for thursday november 24

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

MSDN SQL 2005 versions
Posted by Scott at 11/24/2005 11:23:14 PM
I'm a MSDN subscriber and recently installed SQL 2005 developer edition and noticed it installed a version of visual studio. I'd prefer to install VS pro edition seperate from SQL 2005. Should I install SQL 2005 Standard version instead of developer edition and then install Visual Studio Pro ...more >>


DISTINCT MonthName for a lot of dates....
Posted by Rob Meade at 11/24/2005 11:15:48 PM
Hi all, I have a table with several rows, each has a datetime field. I want to query this table, ideally with my stored procedure and return just a set of month names/numbers if possible, but I keep going around in circles either getting ALL of my dates back with the names in a new column,...more >>

transfer data from sql on WINNT to SQL on 2000
Posted by Pradeep at 11/24/2005 10:19:14 PM
Please suggest links, docs as to how should I transfer data, user information from SQL server on Winnt to SQL on Windows 2000 server. Thanks Pradeep ...more >>

SQL statement help please
Posted by Paul at 11/24/2005 10:11:01 PM
I need to create a "Select" statement for the "TOP" x to y number of the records in the query. I know I can put in like "TOP 10" and it will return the top 10 number of the record. However I want to be able to return a range say Top 20-30 number of the records or Top 30-50 number of the record...more >>

What is the impact of implementing expected Rollbacks
Posted by flatliner60 at 11/24/2005 10:02:02 PM
We have a business Logic component which imports into multiple tables from a variety of flat files. To reduce the length of a lock being held on the tables we were considering that each dependancy tree be first attempted in a single transaction and rolled back. Once all have been through the ...more >>

transfer data from sql on WINNT to SQL on 2000
Posted by Pradeep at 11/24/2005 10:01:56 PM
Please suggest links, docs as to how should I transfer data, user information from SQL server on Winnt to SQL on Windows 2000 server. Thanks Pradeep ...more >>

Still struggling w/ LAST transaction date!!!
Posted by Sam at 11/24/2005 9:46:02 PM
Hi, I've included the necessary scripts to generate tables and insert sample data at the bottom of this post. Here are basic descriptions of 4 tables I included in my scripts: tblCompany contains all necessary information about our clients i.e. company name, phone #, etc. tblDeals co...more >>

selecting from a 6 month date range
Posted by www.pocketpcheaven.com at 11/24/2005 9:10:05 PM
Hi all, SQL Server 2000 and T-sql, uk date formats I have a table, thetable. One of the fields in the table is tran_date which has type of datetime. I have to run a select on the table twice a year. Once after 31st Dec and once after 30 June. The select after 30th June must select ...more >>



using like keyword with variable
Posted by Manish Sukhija at 11/24/2005 9:07:05 PM
Hi All, i have a case in which i want to match records in table which should be start with a word, which i'm storing in a varchar varaible. How could i do this?...more >>

MS SQL Query statement.
Posted by Daniel at 11/24/2005 7:06:02 PM
Hi All, Problem statement: Group 2 tables. B(B_ID,B_DES) C(C_ID,B_ID,C_BY) select B.*,C.* from b bx inner join cx on bx.b_id=cx.b_id group by B column,,C column Output: B_ID column | C_BY 1 we 1 xy 2 DF Above result ...more >>

Database design problem
Posted by Readon Shaw at 11/24/2005 6:45:21 PM
We have to design a database for UserInfo. We already have a user table, and contains userid. There are three user type(ex. student, teacher,admin), they have their own tables. i don't know how to add the personal infomation field. One way is putting some common field into the user table, th...more >>

Modify data structure
Posted by Souris at 11/24/2005 5:41:02 PM
I would like to change the data type from date time to timestamp and nvarchar(14) to nvarchar(20). Are there any impact to change a live database? Thanks millions in advance,...more >>

Return value
Posted by BAT at 11/24/2005 5:26:02 PM
hello check this sp CREATE PROCEDURE dbo.sp_Inserta_bf_PlanOpcionSeleccionBR ( @IdPlan int, @IdPlanOpcion int, @IdGrupoParentesco int, @IdEmpleado as int, @IdAsegurado as int ) AS DECLARE @SqlText varChar(2000), @Result int SET @SqlText=ISNULL((SELECT RTRIM(SqlText) FROM bf_...more >>

SMO SqlExpress Create Database Datafile
Posted by RobertHillEDS at 11/24/2005 4:29:02 PM
I am using SMO to create a database. I use the datafile and logfile objects to define the data and log files. If I use the sqlserverobject.Information.MasterDBPath as the file location it is able to create the database. But if an attempt is made to locate the datafiles in another folder, ...more >>

Roll back database
Posted by Stijn Verrept at 11/24/2005 3:39:31 PM
I have a database running with Full Logging. Now I would like to have that database copied to another one, together with the full log. Roll back the log (in the copied database) for 6 days and then copy a table to the original database. How do I best do this? In steps? -- Thanks in adv...more >>

parse ???
Posted by SharkSpeed at 11/24/2005 1:18:30 PM
how can i parse NameSurname field with t-sql ??? NameSurname --------------------------- John SMITH Eric Smith PHILIPS Name Surname ----------------------- ------------------------ John SMITH Eric Smith PHILIP...more >>

Product Price Range Query
Posted by dontspammenow NO[at]SPAM yahoo.com at 11/24/2005 1:13:47 PM
I've noticed that some search queries on e-commerce sites return "item price range hyperlinks" as filters for matched items. So you would have something like: Under $50 $75-$100 $150-$250 in a row with only the applicable price ranges to the queried products showing. So, with the abo...more >>

What is wrong ???
Posted by Serhat AKALIN at 11/24/2005 12:47:19 PM
hi there, please help me !!! what is wrong ??? SELECT CARI.* , IF(CARI.CH_UNVANI = '', 'EMPTY' ,CARI.CH_UNVANI) , TBLSYSCHTURU.TUR AS CH_TURU FROM TBLCARI AS CARI LEFT JOIN TBLSYSCHTURU ON TBLSYSCHTURU.CH_TURU_ID = CARI.CH_TURU_ID ORDER BY CAR...more >>

What is bookmark lookup
Posted by Roy Goldhammer at 11/24/2005 12:47:05 PM
Hello there On the execution plan i see sometimes Bookmark lookup, who takes a lot of presantage of the query execution What that meens and how can i reduce it? ...more >>

Can I use varible here in Stored Procedure?
Posted by mizi at 11/24/2005 12:39:19 PM
Hi. There are two webpages in my website. one displays 10 articles last updated and another one displays 6 articles last updated. So I want to use only one procedure to do this, and wrote the following code: CREATE PROCEDURE [dbo].[articleLastUpdated] ( @nNumber smallint ) AS SELECT T...more >>

delete BLOB objects
Posted by HenrikF at 11/24/2005 11:55:04 AM
When I delete rows from a table that contains an NTEXT column, I get a delete capacity of 100 rows per second. I think this is slow. How can I make it delete faster? The average size of my ntextcolumn is 22.000 bytes. Max size is 132.246 bytes When I populate the same table with BULK INSE...more >>

Using Clustered Index
Posted by Roy Goldhammer at 11/24/2005 11:13:32 AM
Hello there I got sql database to optimize it. On one of the table has identity column which is the primary key There are also 6 main fields that most of the actions on the server are using them to locate data. and this table has 500000 records and more On the beginning the primary key w...more >>

How to work with extra columns when using bcp?
Posted by Jorge Yanez at 11/24/2005 10:49:25 AM
Hello, I'm using bcp insertion with ODBC from memory variables, but my code is for customer databases that can add his own columns to every table. When people add extra columns to the tables where I do the insertions by bcp, the bcp_sendrow call fails. I've tried the control option BCPKEEPNULL...more >>

Books for Yokun
Posted by J-T at 11/24/2005 10:46:08 AM
Hello Guys, I am completely familiar with DTS and database programming and I'd like to start learning about Yokun version .Which books do you suggest for Analysis services and SSIS and Sql server 2005? Thanks ...more >>

Q: complex SELECT statement
Posted by Petar Popara at 11/24/2005 10:43:49 AM
If I have table with data: ID STATUS 1 1 2 1 3 2 4 3 Can I do this: SELECT COUNT(STATUS = 1), COUNT(STATUS = 2), COUNT(STATUS = 3) FROM MyTable or I have to execute select for each status: SELECT COUNT(ID) FROM MyTable WHERE STATUS = 1 SELECT COUNT(ID) FR...more >>

Use trigger to check data in another tablw
Posted by dwj at 11/24/2005 10:19:24 AM
Hi, I have three tables child, room & toys (crude example) - A room has many toys - A child has one room - A child has one toy. I want to ensure that a child can only have a foreign key value for a toy that is assigned to the foreign key value of room they select. I was thinking of us...more >>

TOP and UNION
Posted by Simon at 11/24/2005 10:13:56 AM
This query returns 2 mediaIDs: SELECT TOP 1 WITH TIES mediaID,count(mediaID)as sumMedia FROM tblMedia GROUP BY mediaID ORDER BY sumMedia DESC This query returns 0 mediaID's: SELECT TOP 1 WITH TIES mediaID,count(mediaID)as sumMedia FROM tblOrders GROUP BY mediaID ORDER BY sumMedia DESC ...more >>

Retrieving grouped data
Posted by JMH at 11/24/2005 8:58:08 AM
Hi, I have a table that contains a simple collection of rows, the rows have the following fields... URN, Year, Period, Cost, Value As an example, the data is as follows... 2005|08|089.32|123.45 2005|10|056.68|045.68 2004|10|156.32|068.23 2005|11|123.56|548.12 2005|11|078.23|569.12 ...more >>

Dynamic Stored Procedure
Posted by jcvd at 11/24/2005 7:32:03 AM
Hi all, I've created a stored procedure with parameters to create 40 tables with the same structure.From VB6 i pass the name of the table to be created from a cmd command. ===================================================== CREATE PROC dbo.CreaTabelleFondi @tablename VARCHAR(6) AS DECL...more >>

XML Schema
Posted by Hege M at 11/24/2005 6:20:06 AM
Hallo! I wondered if anyone can help me with why there is a N' in front of so many of the expressions in create statements? Like this one. CREATE XML SCHEMA COLLECTION DeliverySchemas AS N'<?xml version="1.0" ?> Thanks! H ...more >>

REPLACE SUBSTRING BETWEEN TWO CHARACTERS
Posted by stelioshalkiotis NO[at]SPAM yahoo.gr at 11/24/2005 4:04:30 AM
Hi. I have to replace substrings which are between two characters. For example: I have to replace or remove all the characters that are between ' \': So, i have the string abcde\fgh\ikl and i want to get: abcdeikl. I use the following select statement: REPLACE(ColumnName, SUBSTRING([Colu...more >>

Delete Excel data using OpenRowSet
Posted by Madhivanan at 11/24/2005 1:13:41 AM
It is possible to import or export data to Excel using OpenRowset. I want to delete Excel data before inserting data to it using OpenRowSet, I get this error Server: Msg 7345, Level 16, State 1, Line 1 OLE DB provider 'Microsoft.Jet.OLEDB.4.0' could not delete from table 'SELECT * FROM [t$]'....more >>

Sum() And Nulls
Posted by CJM at 11/24/2005 12:00:00 AM
I have an SP that produces some summary figures, including count() and sum() values: Select (Select Count(*) from OrderDetail D inner join Orders O on O.OrderID = D.OrderID inner join Invoices I on I.InvoiceID = D.CleanInvoiceID Where I.InvoiceDate >= @DateFrom and I.InvoiceDate <= @...more >>

select statement question
Posted by GB at 11/24/2005 12:00:00 AM
Hello, How could I get a result with the following code? BEGIN DECLARE @raws int SET @raws = 10 SELECT TOP @raws * from Table1 END Thanks, GB ...more >>

Difficult question
Posted by Mark Nijhof at 11/24/2005 12:00:00 AM
Hello, I have a table with stock values, they are grouped by a stock id. now I want to get the trend of each stock. I only need this for one value per week for one month. for example: stockid price 1 20 2 10 3 5 1 21 2 9 3 5 1 ...more >>

How can I force some data maintenance statements whether the transactions success or failure?
Posted by ABC at 11/24/2005 12:00:00 AM
How can I force some data maintenance statements whether the transactions success or failure? The case is as: When the insert statement to do, the insert trigger will execute, when the triggers has errors, then the triggers should write the custom messages to the another tables and then ...more >>

Debug Stored Procedure
Posted by Jaime Lucci at 11/24/2005 12:00:00 AM
Hi! How can I do to debug a Stored Procedured? Thsnks. ...more >>

Remote server delete
Posted by Cismail via SQLMonster.com at 11/24/2005 12:00:00 AM
Hi, Can any please shed some light on the following problem or direct me to an information source ? DELETE remoteserver.database.schema.table returns the following error message. iServer: Msg 7345, Level 16, State 1, Line 2 OLE DB provider 'MSDASQL' could not delete from table '"S1031...more >>

A question about execution plans
Posted by Mike Chamberlain at 11/24/2005 12:00:00 AM
Hello, I'm using SQL 2000 with the latest updates. I have a large table Call_Record (5 million rows) that has three indexes: 1. A clustered index on account_no ASC, date_start DESC 2. A non-clustered index on date_end DESC 3. A non-clustered index on call_record_id ASC I'm querying it for...more >>

schedule
Posted by Microsoft at 11/24/2005 12:00:00 AM
I'm running a job from a schedule which runs a .vbs script In this script I have the following script to include another file Function GetFileContents(sFileName) Dim FSO, ScriptFile Set FSO = CreateObject("Scripting.FileSystemObject") Set ScriptFile = FSO.OpenTextFile(sFilename...more >>

What is Table Spool
Posted by Roy Goldhammer at 11/24/2005 12:00:00 AM
Hello there On the execution plan i see some times Table Spool What that meens, and is there a way to reduce its action? -- øåòé âåìãäîø òúéã äðãñú úåëðä èì' 03-5611606 ôìà' 050-7709399 àéîééì: roy@atidsm.co.il ...more >>

Is it best way put all the validation rules on insert/update/delete stored procedure?
Posted by ABC at 11/24/2005 12:00:00 AM
Is it best way put all the validation rules on insert/update/delete stored procedure? When the failure happen from the validation rules, it will return all errors to client. ...more >>


DevelopmentNow Blog