all groups > sql server programming > october 2006 > threads for tuesday october 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 31
Change Single User mode to Multi User Mode on a database
Posted by Naana via SQLMonster.com at 10/24/2006 9:23:19 PM
Hi All,
I have a database in a Single user mode and I can't change it backup to Multi
User Mode.
It set the database into a single user mode and then does a backup and copy
it to another database. The backup was succesful but when it did set the
database into a single user mode to a restore... more >>
How to best return results with specific records first then whatever the order was
Posted by Bill at 10/24/2006 9:19:26 PM
This may just be harder to explain than to do but I want to return results
with some favorite record first and then ordered alphabetically
You see this on some web sites in country dropdowns that are alphabetical
but start with USA
What's the best way to tackle this?
Thanks
Bill
... more >>
Sum on Time
Posted by Leila at 10/24/2006 8:34:23 PM
Hi,
I want to store time of each movie and then calculate sum of them. For
example the user enters the length of each movie like this: 1:35 or 2:05 ...
Should I use datetime type or..?
Thanks in advance,
Leila
... more >>
CONVERT FUNCTION
Posted by gurvar at 10/24/2006 8:18:02 PM
Hi,
I was successfully able to use CONVERT statement
in executing a SQL statement in SQL7.
Ex: I was converting varchar to money back sum it up and
convert it back to varchar to prefix with a $
and finally display.
we moved to SQL2K
the above does not get executed. says can not convert to
... more >>
Q: Need help with view query
Posted by Martin Arvidsson at 10/24/2006 7:42:26 PM
I have problably dug my own grave but here it goes.
I have a table containing the folowing fields:
ProjectID (Auto increments)
ProjectSub
Description
The table is filled like this
ProjectID ProjectSub Description
----------- ----------- ------------------------------
8 0... more >>
How to determine if rows match-off and record the results in the table
Posted by stevehunter_1 NO[at]SPAM hotmail.com at 10/24/2006 7:22:48 PM
Let me illustrate what i am trying to do:
CREATE TABLE myTable
(
quantity int,
stockSymbol varchar(10),
price decimal(18,4)
matchQuantity int,
remainingQuantity int
)
for illustration purposes i will identify the two rows in the table:
ROW1: insert into myTable (quantity, stockSymbo... more >>
dwh problem
Posted by rufian at 10/24/2006 6:22:52 PM
Hi,
I have to choose between
a) using one single fact table
b) using one fact table and several dimension tables
I know that if you have no dimension tables (i.e. you store all the
information on one single fact table) your sql will not include any joins. I
understand joins penalize per... more >>
PROBLEM AT WHERE CLAUSE USING TRIGGERS
Posted by de3a10 at 10/24/2006 4:17:49 PM
iI want to update a table2 each time table1 have an insert here is my
code the erro is
The multi-part identifier "i.tareaID_cl" could not be bound. Did some
one know how to works with triggers
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- ===========================================... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Query 10 times slower (and results reordered!) from ASP.NET page than console app.
Posted by wizofaus NO[at]SPAM hotmail.com at 10/24/2006 4:08:15 PM
I have a chunk of code which is essentially
IDbCommand cmd = db.CreateCommand();
cmd.CommandText = "SELECT X, Y, Count(*) FROM Foo WHERE Z = 1 GROUP BY
X, Y";
using (IDataReader reader = cmd.ExecuteReader())
while (reader.Read())
{
// grab values from query
}
The database is... more >>
create SQL Mobile .sdf from SS05 db
Posted by John A Grandy at 10/24/2006 2:51:29 PM
For an existing SS05 db , how to create its SQL Mobile / SQL Everywhere
counterpart ( and .sdf file ) ?
Is there a tool / utility to do this ?
... more >>
Exam 70-431
Posted by Linda at 10/24/2006 2:38:57 PM
I would like to install the SQL Server 2005 Developer Edition on my
WinXP Pro for using as a test environment for studying for the SQL
Server 2005 Exam 70-431. Is this a good idea? Anyone have suggestions
on how to set-up for just testing?
... more >>
Trigger blocking Insert????
Posted by Toneho at 10/24/2006 2:28:28 PM
Hello all:
I have a "FOR INSERT" trigger defined on a table (dbo.tbl_Ship_Transact
below) that contains no delete statements and no transaction rollbacks.
If I execute
INSERT INTO DPT_MAIN.dbo.tbl_Ship_Transact
(BOL, Stat_Nr, Stat_Dt, Imp_Dt)
SELECT a.BOL, a.S... more >>
Login timeout/SQL Network Interfaces: Connection string is not val
Posted by ksspriggs at 10/24/2006 2:18:01 PM
I just upgraded to the 180-day free trial or SQL Server 2005 from SQL Server
2005 Express. The problem is that I can't get my VB program to work now. I
get the following error:
Program terminating: System.Data.OleDb.OleDbException: Login timeout expired
An error has occurred while establis... more >>
Multiple User data Silos - Notification Services?
Posted by Ruckus at 10/24/2006 2:02:02 PM
I'm wondering if notification services is the right solution for this task or
if there is something better suited.
Scenario:
Multiple databases containing similar information about people. Multiple
interfaces for interacting with data. (e.g. Desktop app against Oracle, Web
app against SQL,... more >>
NVARCHAR(MAX) Variables
Posted by Calvin at 10/24/2006 1:49:02 PM
I'm working on some dynamic SQL and debug the string by PRINTing the variable
to the Results pane. I've noticed that SQL Management Studio truncates my
variable to 4000 characters, but when I debug the variable in Visual Studio,
I see the entire string.
Why does SQL Management Studio trunc... more >>
Insert Select
Posted by Emma at 10/24/2006 1:48:02 PM
I want to insert zero values in a table if the select statement returns null.
Example
Insert mytable(field1,field2)
select field1,field2 from anothertable
The insert works fine if the select statement returns a row. I still want
the insertion to take place even if no record is returned bu... more >>
Sybase/Sql server Outer Joins, nulls, and counts
Posted by dba_222 NO[at]SPAM yahoo.com at 10/24/2006 1:33:43 PM
Dear Experts,
I'm an Oracle guy, but I've been given an assignment to compare data in
two different Sybase "databases".
Given that I don't have the MINUS, or the INTERSECT command, and in
this Sybase version, not even the inline views, I am trying to use
Outer Joins.
Now, in Oracle, when... more >>
Performance tuning of Large Select / Insert operation
Posted by mwhitis NO[at]SPAM gmail.com at 10/24/2006 1:22:16 PM
I'm working on parsing and converting a large data set that's generated
by a 3rd party application for us. The data I'm going after is stored
in a table with 4 int columns and a TEXT column. I'm writing some code
to parse the data out of the TEXT columns and write them to 2 new
datatables so t... more >>
sqlserver date insert question
Posted by modhak NO[at]SPAM gmail.com at 10/24/2006 1:04:57 PM
Hi All
I use SQLServer 2005
I use JDBC to insert values into database.
My date is like this...
Release Date is:10/25/2006
SQL:
insert into releases(appid, releasedate) values(?,
to_date(?,'MM/dd/yyyy'))
I can get this to work in oracle. However in SQLServer 2005 I get this
exceptio... more >>
Regd SQL Server 2005 Express Edition
Posted by Jyothi Gunturu at 10/24/2006 12:42:04 PM
Hi All,
I plan to create a commercial web site. I'm thinking of various options =
for my database. I cannot afford money to buy a full licensed version of =
SQL Server. I thought to use SQL Server 2k5 Express as DB.
Can any one suggest me the pros and cons of this.
Thanks
GJ.... more >>
Improving a Query That Works?
Posted by Don Miller at 10/24/2006 12:07:01 PM
Although I've found a way to do it, I wonder if there is a more elegant or
efficient way to craft a basic generalizable query that finds, in this
example, all customers who have never ordered an 'ipod'.
For example, a database with two tables (Customers - CustID, CustName,
Orders - OrderID, Cu... more >>
History Summary Analysis and Inspection Periods!
Posted by Jay Balapa at 10/24/2006 11:37:50 AM
Hello,
I have two tables-
TBLHISTORY with the following fields-
BARCODE ITEMTYPE PASS DATEINSPECTED
1000 x YES 01/12/2004
1000 x YES 06/12/2004
1000 x NO 01/12/2005
1000 x NO... more >>
Trigger query
Posted by FARRUKH at 10/24/2006 11:15:02 AM
i want to write a trigger that enforce user to input valid data. For e.g. I
want user input 'CR0001' all the time. If user just input '0001' trigger stop
them and ask to input valid data input like 'CR0001'
thanks
Farrukh... more >>
SQL Date & Time manipulation
Posted by Blasting Cap at 10/24/2006 10:42:12 AM
I'm trying to test a date & time function to make sure I have all the
records in a particular time frame.
There are two things I need to do, in order to test the query.
One, I need to ensure that the time stamp on my date variable is set to
12:00:00 AM - the same as what's on the database ... more >>
Newbie, how to assign query reults to 2 variables
Posted by xdude at 10/24/2006 10:24:34 AM
Hi guys,
i'm running Sql Server 2000, i think this is a stupid question but please
have patience i'm a new to this stuff :(
I've the folloing query that returns 2 fields (below), how can I assign the
2 values returned by the query to 2 variables for example @GrossAmount and
@GrossQuant... more >>
Scripting Index Drop and Recreation
Posted by Jerry.Sommerville at 10/24/2006 9:54:01 AM
I know that I can right click on a index object and script the drop and
create, but I need to drop and recreate over 2000 indexes on a BIG database.
I found a script from SQL Server 2000 that will generate a script for all
indexes but it does nto work in Sql Server2005. Does anyone out there... more >>
ANSI_NULLS., QUOTED_IDENTIFIER, ARITHABORT
Posted by Sameer Gupta at 10/24/2006 9:45:02 AM
Hi
I am having an ASP.Net app on sql server 2000.
I am calling a stored proc from app.
It has an UPDATE Statement but it is giving me error:
"UPDATE failed because the following SET options have incorrect settings:
'ANSI_NULLS., QUOTED_IDENTIFIER, ARITHABORT'."
If I run it from Query ... more >>
How to create historical Data Backups
Posted by Henry Jones at 10/24/2006 8:51:17 AM
I have a table that keeps track of Interest rates that a bank charges. Each
Friday I would like to take the records and copy them to another table and
include the current date the record was added to the History Table.
The structure of the table is:
InstitutionID int
InstitutionProduct ... more >>
Accessing tables from remote table in SQL Server 2005
Posted by Usman at 10/24/2006 8:50:33 AM
Hi,
In SQL Server 2000, when I had to access tables in one db from a VIEW
in another db, I used following syntax,
[dbname].[username].[tablename]
like for example if I am creating a VIEW in db1 that reference table1
in db2, I'll use following query to create a view,
Create VIEW TESTVIE... more >>
set the data type of a derived column in the select statement.
Posted by Alpine7 at 10/24/2006 8:33:25 AM
I run a select statement against a table and have a derived column I
would like to populate with a null value as a place holder. The data
type needs to be "datetime" Something like this;
SELECT start_date, end_date, 'null' AS maturity_date
>From Securities Where symbol = 'abc'
I run the se... more >>
Query help please
Posted by wadefleming NO[at]SPAM yahoo.com at 10/24/2006 8:18:38 AM
Say I have the following table:
Person with fields (Name,Ethnicity)
ie:
CREATE TABLE Person (Name VARCHAR(30), Ethnicity VARCHAR(30))
And the following entries:
insert Person values('Joe','European')
insert Person values('Paul','European')
insert Person values('Andrew','Other')
I then ... more >>
Insert Problem
Posted by Tom Roth at 10/24/2006 7:24:01 AM
I have 2 SQL Server servers running SQL Server 2000. They are "Linked"
together. I have a stored procedure that is located on both servers. The
stored procedure works fine on one server and errors out on the other.
Server A contains the tables. The stored procedure works fine on this
se... more >>
Conversion failed when converting from a character string to uniqueidentifier
Posted by amit.vasu NO[at]SPAM gmail.com at 10/24/2006 7:17:48 AM
Hi All
I have two tables say Table1 and Table2.
Now in Table1 I have UserID which is uniqueidentifier and primary key
for that table.
In Table2 I have UserID which is varchar and Foreign Key.
When I write a query and say
Table1.UserID = Table2.UserID I get the message
Conversion f... more >>
sleeping process causing blocking
Posted by Sammy at 10/24/2006 7:05:02 AM
I have a strange problem? I used sp_who2 to identitify a blocking query, the
blocking query was actually sleeping? when I used dbcc inputbuffer() to get
the query it came out with sp_executesql;1
The user is using an access frontend app, but how can a sleeping process
cause blocking?
... more >>
Size of Binary data
Posted by Oracle Dave at 10/24/2006 6:43:40 AM
Hi All,
I've got a database that's full of "image" columns. These typically
contain invoices stored as PDF documents and customer signatures stored
as JPEG images.
I need to do a bit of analysis to project the rate of growth of the
system.
What I'd like to do is retrieve the size of the bi... more >>
Ranking with Sql Server 2005
Posted by amit.vasu NO[at]SPAM gmail.com at 10/24/2006 6:35:09 AM
Hi All
I have a table with the following schema.
QuestionID UserID Answer
1 1 2
1 2 2
1 3 2
1 4 3
2 1 1
... more >>
Problem with MS DTC 2: OK!
Posted by checcouno at 10/24/2006 6:26:01 AM
My problem with MSDTC is ok now, but the solution is quite strange!!!
when i compose my remote table name for access table on a remote server
(linked server) i use this fulle name:
MYREMOTESERVER.MYREMOTEDB.dbo.MYREMOTETABLE
this sintax sometimes (only sometimes and ONLY INSIDE A DISTIBUTE... more >>
What's the sql 2005 version of this
Posted by DBA72 at 10/24/2006 6:01:02 AM
I have a central repository with data about my servers. I am now updating the
repository to also store data about my 2005 servers. Does anyone know the
equivalent of this in SQL 2005?
select s.srvname
,s.providername
,s.datasource
,l.[name]
,s.srvproduct as [Remote Login]
from m... more >>
vb.net-SP Access denied
Posted by Uli at 10/24/2006 5:39:01 AM
Hi,
I have a Stored Procedure in VB.NET and publish it via Visual Studio 2005.
By calling it from a webapplication, I get execute access denied for the
Stored Procedure.
I can't give Access-Rights to the Procedure while I'm publishing it.
Everytime I publish it new to the SQLServer I'm loos... more >>
Combine multiple insert queries into 1?
Posted by Duke Carey at 10/24/2006 4:39:01 AM
Disclosure: I'm not sophisticated about SQL, and thanks for looking at this.
A vendor provides us with information about deposit amounts at each bank
branch in the country, by year. Unfortunately the data for an individual
branch is in a single row, in the form of BranchKey, 2006, 2005, 200... more >>
select distinct problem
Posted by HaVoK at 10/24/2006 4:07:47 AM
Hello,
i want to do an select like this:
SELECT tkopf.materialnr, SUBSTRING(torg.produkt_hierarch, 11, 8) AS
Plangruppe, torg.materialgruppe AS prodartkz, tkopf.mengeneinheit, '1'
AS kond_p,
'0' AS generiert, torg.garantie_biz, '1' AS
sperrkz, '99' AS erz_status
... more >>
view locked records
Posted by Ganesh at 10/24/2006 4:04:01 AM
Hi There,
When i run the following on query analyser, i see same record count for both
find memb select query.
I'm doing some testing to see the locked record
SET TRANSACTION ISOLATION LEVEL READ COMMITTED
begin tran
update findmemb
set adminref = 1422
where record_id = 47183
... more >>
Access lotus domino mail from sqlserver
Posted by nigelrivett at 10/24/2006 3:57:40 AM
I need to be able to read mail and download attachments from a lotus
domino email account (need to send too but that should be easy).
I've done all this using exchange but never been at a place with this
before.
The domino server is maintained by an outside company so I won't be able
to con... more >>
SQL script to compare dates in a table and update date entries
Posted by simonboland NO[at]SPAM gmail.com at 10/24/2006 3:55:54 AM
I have a populated SQL table called "schedule" which contains several
fields but the two important fields for this question are:
- createdDateTime (when the schedule was created)
- startDateTime (when the schedule started)
The startDateTime should not be before the createdDateTime. However... more >>
SQL Server 2005 XML Support Question..
Posted by Chris Ashley at 10/24/2006 2:58:37 AM
I'm pretty new to SQL Server 2005 and have been reading about the built
in XML support and am trying to figure out whether it is going to work
for my needs.
I have an XML document structured like so:
<?xml version="1.0" encoding="utf-8"?>
<Log xmlns:xsi="http://www.w3.org/2001/XMLSchema-ins... more >>
Top 100 ... Order by in views SQL 2005 problem
Posted by James at 10/24/2006 2:30:02 AM
The following Microsoft article says that use of Orderby in views is now
ignored in SQL2005.
http://msdn2.microsoft.com/en-us/library/ms143179.aspx
There seems to be a work around:
http://oakleafblog.blogspot.com/2006/09/sql-server-2005-ordered-view-and.html
This involves changing the ... more >>
SQL Server 2000 problem with using a InputStreamReader against an image field
Posted by Pat.Harms NO[at]SPAM gmail.com at 10/24/2006 1:46:14 AM
Dear All
I have a problem using the MS SQL Server 2000 JDBC SP3 drivers to
binary data from an image field, on a MS SQL Server SP4 system. I did
post this in the jdbcdriver newsgroup, without any response :-( .So I
thought, I'd tried my luck here :-).
The data I store in this field, can be ... more >>
Consuming a Web Service (End Point)
Posted by Leila at 10/24/2006 12:00:00 AM
Hi,
I have created an SP and defined an End Point to expose my SP as a Web
Method named "EmployeeList".
I can successfully use it in VB.NET but cannot understand what the
"Credentials" means in my code!
Assuming that my Web Reference is WR1, this is my code:
Dim x As New WR1.GetEmployees
... more >>
how to make this smaller?
Posted by msnews.microsoft.com at 10/24/2006 12:00:00 AM
Hi, can i do this with only one select?
SET @TD_Nm = ( SELECT (Nm) FROM Actor WHERE CustNo = @TD_KundeNr )
SET @TD_Ad1 = ( SELECT (Ad1) FROM Actor WHERE CustNo = @TD_KundeNr )
SET @TD_Ad2 = ( SELECT (Ad2) FROM Actor WHERE CustNo = @TD_KundeNr )
/Per W.
... more >>
Event Notification vs. Triggers
Posted by Leila at 10/24/2006 12:00:00 AM
Hi,
Event Notifications can send a message to particular service while this can
be done exactly in a trigger. I mean the DDL/DML trigger can send required
message to a service for asynchronous processing. So what's the advantage of
using Event Notification?
Thanks,
Leila
... more >>
|