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 2006 > threads for tuesday october 31

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

Left join is equal to inner join?
Posted by Gogzilla at 10/31/2006 8:40:02 PM
Hi All I try to calculate the result by using left join but it still returns the output same as using inner join. ************************************ Table1(T1) Status_id Score_id SumOfAmount Chief Excellent 1 Chief Fair 1 Chief Good 2 DD Fair ...more >>


Undefined at compile time number of parameters
Posted by ggeshev at 10/31/2006 5:27:03 PM
Hello! I would like to implement a stored procedure as a CLR one. CREATE PROCEDURE MultiParamSP ( @a nvarchar(100) = '', @b nvarchar(100) = '', [..., n] ) AS EXTERNAL NAME ...; I would like MultiParamSP to support undefined at compile time number of nvarchar(100) parameters. ...more >>

sysprocesses.sql_handle always = 0x0000000000000000000000000000000000000000
Posted by sauve mark at 10/31/2006 3:32:35 PM
Hi, I'm using fn_get_sql() to inspect which line of code is currently being executed by a particular process (spid), but I've noticed that in most cases sysprocesses.sql_handle = 0x0000000000000000000000000000000000000000 And therefore fn_get_sql() return null Is this a bug in SQL ...more >>

datatable to XML
Posted by Curtis at 10/31/2006 2:49:02 PM
I have a datatable that I need to pass to xml so I can pass the xml as a parameter to my stored procedure, but I am lost. I don't want to write the datatable to a xml file. Any help is appreciated. I am using vb and sql 2005...more >>

datatable to xml
Posted by Curtis at 10/31/2006 2:48:02 PM
I have a datatable that I need to pass to xml so I can pass the xml as a parameter to my stored procedure, but I am lost. I don't want to write the datatable to a xml file. Any help is appreciated. I am using vb and sql 2005...more >>

datatable to xml
Posted by Curtis at 10/31/2006 2:47:03 PM
I have a datatable that I need to pass to xml so I can pass the xml as a parameter to my stored procedure, but I am lost. I don't want to write the datatable to a xml file. Any help is appreciated. I am using vb and sql 2005...more >>

create view in specified database
Posted by philbrierley NO[at]SPAM hotmail.com at 10/31/2006 2:35:04 PM
how do I create a view that lives in the views of the current database, rather than in the master database? the following gives me the syntax error message, ('CREATE VIEW' does not allow specifying the database name as a prefix to the object name.) CREATE VIEW COMP.dbo.ViewBICUP AS ...more >>

Subtracting Row from One Another
Posted by GarrettD78 at 10/31/2006 2:34:02 PM
I have a table the stores fueling data from trucks that we run. The only problem is we would like to be able to do some miles per gallon and other queries on the data, but to know this we need to be able to find out how many miles they went before filling up. The information only has an odomet...more >>



Subtracting Row from One Another
Posted by GarrettD78 at 10/31/2006 2:33:01 PM
I have a table the stores fueling data from trucks that we run. The only problem is we would like to be able to do some miles per gallon and other queries on the data, but to know this we need to be able to find out how many miles they went before filling up. The information only has an odomet...more >>

Best approach for comparing rows
Posted by Jason at 10/31/2006 1:43:02 PM
I am using SQL 2005 to create a process that will access an FTP site, download a text file and insert the data into my table. After the initial load I would like to insert only those records that are new (or changed). Unfortunately our vendor provides a complete text file of all records so ...more >>

better / performance enhanced approach to the given query?
Posted by Shocky at 10/31/2006 1:20:59 PM
Can anyone please suggest a better, performance enhanced approach to write the below query without compromising the logic ;) DECLARE @a_Company VARCHAR (20) DECLARE @a_Deptt VARCHAR (20) SET @a_Company = 'All' SET @a_Deptt = 'All' select gd.Company,gd.Deptt, gd.Group from GROUPDA...more >>

trigger
Posted by FARRUKH at 10/31/2006 1:15:01 PM
someone asked me to write a trigger to validate the record that has been inserted, not all of them. I am really confused. I dont know how to validate the particular record that aleardy inserted. Any ideas? Farrukh...more >>

SCOPE_IDENTITY() not returning a value?
Posted by vtxr1300 at 10/31/2006 1:00:00 PM
We have multiple databases on one server and for my project, I have one database working with data in another. The 2nd database is one designed and supplied by a software vendor so I can't go in and modify their structures because if we install an update, it could overwrite everything we do. S...more >>

better / performance enhanced approach to the given query?
Posted by Shocky at 10/31/2006 12:56:43 PM
Can anyone please suggest a better, performance enhanced approach to write the below query without compromising the logic ;) DECLARE @a_Company VARCHAR (20) DECLARE @a_Deptt VARCHAR (20) SET @a_Company = 'All' SET @a_Deptt = 'All' select gd.Company,gd.Deptt, gd.Group from GROUPDA...more >>

performance issue of the given query
Posted by Shocky at 10/31/2006 12:33:45 PM
Hi, I am using Microsoft SQL Server Reporting Services 2000. I want to know, how to get report in more than one page? Can anyone please suggest a better, performance enhanced approach to write the below query without compromising the logic ;) DECLARE @a_Company VARCHAR (20) DECLARE @a_D...more >>

Retrieve random PK
Posted by David at 10/31/2006 12:24:25 PM
We have a SQL 2005 database that was created via an Access upload. The Access database was a replicated database at one time and has some Autonumber columns converted to a random number generated trigger (see example below). DECLARE @randc int, @newc int /* FOR AUTONUMBER-EMULATION CODE */...more >>

Using a DataGrid in VB6
Posted by Ellie at 10/31/2006 12:22:18 PM
Hi, I'm trying to populate a DataGrid with a recordsource query result that uses a join. That works fine but I'm not allowed to edit the underlying tables. Can anyone point me in the right direction. Thanks ...more >>

Using wild char inside in ()
Posted by Hitesh at 10/31/2006 12:03:20 PM
Hi, I am wondering if there is a way to use wild char with IN. i.e. select * from TblTest where custerName LIKE IN ('John%', 'doe%') Thank you, hj ...more >>

Need help with a query
Posted by rk2008 NO[at]SPAM gmail.com at 10/31/2006 11:38:34 AM
I have a table with following rows. Column1 Column2 Data1 NULL Data1 NULL Data1 NULL Data1 NULL Data1 NULL Data1 NULL Data2 NULL Data2 NULL Data2 NULL Data2 NULL Data2 NULL...more >>

Transaction IsolationLevel
Posted by Joe Fallon at 10/31/2006 11:38:12 AM
In my code I am using IsolationLevel.Serializable. I am not 100% clear on the best level to use and the explanations below don't really help me to make a decision. Is my choice too restrictive? Will I run into problems (deadlocks) using this? Should I just use the default ReadCommitted? Whta a...more >>

Scope Identity and ADO.Net Transaction
Posted by Joe Fallon at 10/31/2006 11:24:52 AM
I use code like this to Insert a row into a table which has an Identity. Notice that a running transaction is passed in to the method as the variable tr. The insert command runs and then next command is SELECT Scope_Identity(). Protected Overridable Sub InsertData(ByVal tr As IDbTransactio...more >>

Max Memory
Posted by Ari at 10/31/2006 10:41:01 AM
What's the max memory SQL 2000 or 2005 can handle? ...more >>

need some advice..
Posted by Brian L at 10/31/2006 10:36:02 AM
I need to query data that sits in a remote SQL 2K server from a SQL 2K5 server. When querying remote sql servers, how does one go about doing this? I have limited SQL programming experience and just need someone to point me in the right direction. Many thanks....more >>

How to do a fast Count?
Posted by sdragolov NO[at]SPAM gmail.com at 10/31/2006 10:14:56 AM
Hi - I would like to perform a fast count on a recordset returned by a query. Here is what i've tried so far... 1) count(1) and count(*) on the record set both are too slow for what I need 2) tried selecting the recordset into a cursor, however, I need to Open (and then Close) the cursor in ...more >>

how to create a schema programmatically? tia
Posted by ja at 10/31/2006 9:58:19 AM
Hello, How do you create a schema of a database programmatically? ja...more >>

procedural logics in sp
Posted by JJ at 10/31/2006 9:32:19 AM
As far sql server reusing the query plan caching, would it be advisable to have procedural logics in one sp? For example, based on the status sent in, i will have different joins to get the desired result set. How does query plan caching really work if I have procedural logic like below? Does ...more >>

Error while running the below code[-2147217900]
Posted by Amit D at 10/31/2006 8:53:45 AM
strconn = " Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=sa;Initial Catalog=TestDB;Data Source=servername" cn.Open strconn strSQL = "SELECT * INTO XLImport8 FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0','Data Source=D:\SLR\SLR.xls;Extended Properties=Excel 8.0')...[Sh...more >>

Right outer Join
Posted by Ankith at 10/31/2006 8:42:02 AM
Hi: I am trying to understand the real reason for the need for a right outer join. I do understand the differences between a right outer join and a left outer jon however i think and please correct me if i am wrong i can basically get the same resultset what i get using a left outer join by...more >>

aggregate concatinate on join?
Posted by jobs at 10/31/2006 8:26:55 AM
Two tables: tab1 id name tab2 id date I'd like to produce tab3 id names date where names = all names for an the id concatinated seperated by '-' for example id names date 555 john-mary-bill-bob 10/27/2006 556 jim-rob-will 10/3...more >>

Can you use TOP, GROUP BY, ORDER BY or use HAVING within an EXISTS subquery?
Posted by kgerritsen at 10/31/2006 8:20:56 AM
I have a table, tblComponent, which I want to use to feed a listbox in an application. The field I want to use (NAME) is not a key, and there are numerous duplicate entries. In fact, I want to eliminate the top two entries (a default value and blank) because they are unnecessary to the busines...more >>

Need help with Query
Posted by amit.vasu NO[at]SPAM gmail.com at 10/31/2006 7:35:28 AM
Hi I am using sql server 2005. I have two tables. 1) SurveyAnswer Schema for SurveyAnswer is as below UserID QuestionID SectionID Answer --------------------------------------------------- 1 1.1 F Collaboration 1 2.1 ...more >>

How to find the NULL counts and non NULL counts?
Posted by dba_222 NO[at]SPAM yahoo.com at 10/31/2006 6:39:01 AM
Dear experts, I am finding a LOT of rows with NULL columns in the Sybase tables I'm querying. Say, there is a table, with 100 rows. 25 rows are NULL 75 rows are NOT NULL. What I'm trying to eliminate is: select count(*) from some_table where fieldx is null and then running the ...more >>

Need help in writting Query
Posted by Mukut at 10/31/2006 5:18:37 AM
Hi all, I have a table like this create table mytable ( Uniqueq int IDENTITY(1,1), DOC nvarchar(50), ) After inserting some values,the table look like this.... Uniqueq DOC 1 Doc1 2 Doc1 3 Doc2 4 Doc3 5 Doc4 6 Doc5 7 Doc1 8 Doc2 9 Doc3 10...more >>

Passing a IN value list to a SP
Posted by planetmatt at 10/31/2006 4:26:44 AM
Is it possible to pass multiple values into a SP for use in a IN WHERE clause? example: exec sp_spname "'user1','user2','user3'" and then in the SP: select * from users where username in (@username) ...more >>

Reserve One CPU for OS ?
Posted by LanLan at 10/31/2006 2:50:02 AM
One of our SQL box is running extremely slow. It has four CPUs. Some one suggested that we should take one CPU off, so that OS can use it dedicately. Leave the OS only three CPUs. He insisted this is a best pratice, I doubt. Can any one put some insight ? The OS is SQL 2000 Ent....more >>

If null ?
Posted by Goofy at 10/31/2006 12:00:00 AM
I have a view which links a logfile containing the username and the personell table, this way I can display the users full name rather than some acronym. Sometimes log entries are made by the system with an identifier which does not relate to a person so this shows as a null. I need to c...more >>

Identity column - how to find the next ID that will be generated by MS SQL Server?
Posted by Sinex at 10/31/2006 12:00:00 AM
Hi, I have a table with one of the fields maked as an Identity column (auto increment...). In my application I want to determine the next ID that SQL Server will generate! Is this possible? As far as I've seen, only when I actually insert a new record in the table I'm able to see the next auto...more >>


DevelopmentNow Blog