all groups > sql server programming > april 2006 > threads for tuesday april 11
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
Bulk insert of a .dbf file
Posted by Shailesh at 4/11/2006 11:30:01 PM
Hello every one,
I am using bulk insert to transfer hugh data from a .dbf file to my sql
server table. Can you guide me in this case what shoud I specify as
fieldterminator and rowterminator?
Thanks in advance.
Regards,
Shailesh... more >>
Help w/ TSQL Code in Stored Procedure
Posted by andrew.sher NO[at]SPAM gmail.com at 4/11/2006 11:17:38 PM
Using asp.net's aspnet_regsql.exe tool, I created the
tables/procedures/views in sql server 2005 expess edition necessary to
support the .net 2.0 membership system in a website. I'm having an
issue with the Membership.deleteUser function,which calls a stored
procedure. The error I'm getting is a... more >>
Part
Posted by RATA at 4/11/2006 11:15:01 PM
Hi folks,
I posted this somewhere else here, excuse me,,,
I have the following challenge
When I create a stored procedure the selects data from the portioned view,
the execution plan shows that SQL server scans all base tables, while the
select statement after replacing the variable with an a... more >>
Help SQL Server 2000
Posted by Bpk. Adi Wira Kusuma at 4/11/2006 10:35:35 PM
When I have done to attach database at server with certain collation. So how
to change its collation like as i want?
Because I've tried to use "ALTER DATABASE .... COLLATE ...", But it doesn't
change all tables.
How to to change its collation like as i want so simple?
... more >>
Transfering database diagram
Posted by Alur at 4/11/2006 8:41:01 PM
How can I transfer database diagram
to another database with another name but with the same content
which copyed with the
help of the Data Transformation Service ?... more >>
Changing all existing tables collations in one step
Posted by Alur at 4/11/2006 8:31:01 PM
I can change table collation first table column by column
then second table and so on (Alter table table_name
alter column column_name COLLATE < collation_name> ).
How can I change all existing tables collations in one step ?
Where can I find some program in Transact-SQL or some procedure to... more >>
JOINING TWO TABLES ERROR
Posted by heri at 4/11/2006 4:02:54 PM
How can i Join these 2 table ? I am getting an error my LEFT OUTER JOIN
DOESNT WORK thanks
SELECT EmployeeNo, Datehired, SectionCode,
Department,Lastname,Firstname
FROM (dbo.Employees H1
GROUP By EmployeeNo, Datehired, SectionCode,
Department,Lastname,Firstname)
dbo.Employees LE... more >>
SQL Server 2005 TSQL Stored Procedure question
Posted by Russell Mangel at 4/11/2006 3:49:31 PM
I have a TSQL Stored Procedure in SQL 2005 that has a Default value.
Like this:
CREATE PROCEDURE [dbo].[MyTSQLStoredProcedure]
@CompanyID INT = 9 -- Default Value
My Question:
How do I get the Default Value, in this case the value is 9.
I have looked in the following places:
SELECT *... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Best practice
Posted by Perry van Kuppeveld at 4/11/2006 3:36:42 PM
Hi,
I'm writing an application using a sql server database. In this database
there roughly 3 kinds of tables:
1. tables containing data which is generated during the run of an
application
2. tables containing data entered by our clients
3. tables containing data entered by our compagny.
... more >>
Sending Temp table to csv
Posted by Roy Goldhammer at 4/11/2006 3:27:47 PM
Hello there
I've created temp table with require data.
I need to send it as csv file. I can do this by using it by running select *
from #tmp at query anlyser. and on the result use save as.
The problem is that on this case the titles are not being transfered
Is there a way by query an... more >>
Query Compilation Plans
Posted by helpful sql at 4/11/2006 3:03:11 PM
Hi all,
We have a third party application that makes extensive use of
sp_executesql which allows it to reuse compilation plans for the sql
queries. Now, I am trying to monitor what the application is doing using the
Profiler. Since the application reuses compilation plans, often I am not ... more >>
Case sensitive query
Posted by simonZ at 4/11/2006 2:48:30 PM
I would like to execute query:
select Column1 from table
and I get an error message:
Invalid column name 'Column1'.
If I write query like this:
select column1 from table
than it works.
It looks that server is case sensitive for columns and tables. How can I
change this?
Oth... more >>
Is this Correct database design
Posted by Robert Bravery at 4/11/2006 2:12:11 PM
HI all,
I have a claims database, which has a header table, details table and
otherinfo table. The header table will contain claim header info, ie
claimnumber date of loss etc., the details would contain claim detail, as
details of loss, damage ammounts, etc, the otherinfo contains information... more >>
Executing DTS Package - Error not able to find the package.
Posted by Raj25 at 4/11/2006 1:50:02 PM
I am running Sqlserver 2005 and IS.
Here is the SP I am running.
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
-- =============================================
-- Author: Name
-- Create date:
-- Description:
-- =============================================
ALTER PROCE... more >>
Sending a IMAGE to a xp_proc
Posted by Daniel Halan at 4/11/2006 1:16:48 PM
Hello,
Im wondering how would one send a "image" field from a table as a parameter
to a ExtendedProcedure?
(from inside a StoreProcedure)
example: (if Image was a possible Local variable)
DECLARE @docdata image
SELECT @docdata = imgData from DokInfo where Dok_ID=19
EXEC master..xp... more >>
Query Question
Posted by Charles Allen at 4/11/2006 1:06:02 PM
I have a table with the following columns: assetid and transtype. There are
multiple records per asset and different transtype values.
I am trying to create a list of all distinct assetid's that do not have a
transtype of 'DPR'. They can have any other transtype.
For example:
00001 ... more >>
Convert Year to Date
Posted by KatMagic at 4/11/2006 12:39:15 PM
I need to take an integer field that is supposed to be a year, and convert
it to be a date field, with the date being 1/1/Year for whatever the year
is. So 1990 would update to be 1/1/1990 -- How can I do that?
Thanks for your help.
... more >>
best way to get related tables?
Posted by KBuser at 4/11/2006 12:38:38 PM
SQL Server 2000 : ASP w/ C# Codebehind 2.0 framework
I'm building an intranet site to query our database. ON the initial
page is a checkbox list of all the user tables in our DB. When a table
is first checked, I want to query the database and disable all
checkboxes representing tables not rela... more >>
Order By Adding Rows??
Posted by Skip at 4/11/2006 12:09:43 PM
Hi All,
Having trouble with the following SQL statement. If there is multiple
ORDER by's it adds rows to the result. The SQL statement below adds
rows to the result, if I remove block_line_no
from the orer by it returns the correct data.
SELECT *
FROM nc_block_data
WHERE (PROGRAM_ID = 26... more >>
Need a function for banker's round
Posted by Peter Widmer at 4/11/2006 11:12:14 AM
Hi all,
has anyone of you an approved banker's round function for sql?
IT needs to work with positive as well as with negative amounts....
I'd be very very happy if anyone could help me out!
Best regards
Peter Widmer
... more >>
Unable to update SysLogins
Posted by ChrisR at 4/11/2006 10:57:02 AM
Howdy all. I added the 400 + logins to my new SQL box following the script
directions here: http://www.support.microsoft.com/kb/246133/
FYI I did not already have my User DB's on the new box. Anyways, it worked
but it did not transfer the default DB as the article says it wont under
these ... more >>
Problem passing parameter into remote stored proc
Posted by zev_steinhardt at 4/11/2006 10:28:19 AM
I'm having a problem passing a parameter value into a stored procedure
that I am running on a remote (linked) server, and am receiving a DTC
error because of it.
I have a stored procedure that brings in a variable (@CustID int). I
later pass that parameter to another stored procedure. The code... more >>
sending email alerts from Sql Server
Posted by helpful sql at 4/11/2006 10:20:46 AM
Hi,
I would like to send email alerts from Sql Server when a Sql Server job
fails. When I try to send a test alert from Sql Server, it gives me an error
saying something like "Outlook is not set as the deault client". I don't
know how to fix this. Can anyone please help?
Thanks in advan... more >>
Error connectiong to database
Posted by helpful sql at 4/11/2006 9:52:13 AM
Hi,
I am designing a webpage with the DbNetGrid control on it. I am folloing
its documentation and using the following connection string to connect the
grid control to a database:
'Provider=SQLOLEDB;Driver={SQL
Server};Server=(local);Database=pubs;Trusted_Connection=yes;'
But DbNetGr... more >>
Include column names in resultset - is it possible?
Posted by sydney.luu NO[at]SPAM gmail.com at 4/11/2006 9:44:34 AM
This is probably not a practical thing to do but I'd like to know if it
is possible
to include the column names as part of the resultset in my stored
procedure? The column
names could be the first row or and the last row of the resultset. The
number of columns
returned is unknown until runti... more >>
Select Where NOT IN not working?
Posted by plc at 4/11/2006 9:10:40 AM
Hi All,
I have a small temp table (40 rows) that contains 2 fields (and others) with
a reading ID and a previous reading ID.
I want to select all reading ID's that do not appear in the previous reading
column.
When I run
SELECT ReadingID FROM tmpData
WHERE ReadingID NOT IN (Select DI... more >>
Enterprise Manager 2/ Me 0
Posted by B NO[at]SPAM DJJ at 4/11/2006 8:31:02 AM
Ahoy All!
Say I come in, bright-eyed-and-bushy-tailed in the AM and say "Hey! I think
I'll add a field to a table this Bright and Glorious morning!" so I fire up
Enterprise Manager (v 2.0) with the SQL Enterprise Manager (v 8.0) (running
on XP SP2 hitting a SQL Server 2000 SP4 DB running o... more >>
ROLAP Vs MOLAP
Posted by Jportelas at 4/11/2006 8:31:02 AM
Hi there:
Does anyone has any suggestions when building a ROLAP Cube? should I go with
ROLAP or go MOLAP with analysis Services? which one is better?
Thanks a lot.
--
Jairo... more >>
Data driven query - update only CERTAIN fields?
Posted by champ.supernova NO[at]SPAM gmail.com at 4/11/2006 8:23:29 AM
Hi,
I'm trying to set up a Data Driven Query task, to update only certain
fields in a table.
However, even though the update query only contains the fields I'm
wanting to update, when I try and run it I get:
"One or more destination parameter columns had no transform specified"
Thing i... more >>
Avoid duplicate index while creating temp table
Posted by Wingman at 4/11/2006 8:09:03 AM
We are using SQL 2K with sp4.
In our stored procedure, we create a temp table (i.e. #tablename) and
various indexes within the temp table. If mutliple users execute this stored
procedure at the same time, it would cause duplicate index error. As a
temporary fix, we attach an unique number... more >>
what tables referenced in a diagram
Posted by jemkem NO[at]SPAM yahoo.com at 4/11/2006 8:07:13 AM
Is there a way to programmatically determine which tables are
referenced in a database diagram?
Thanks,
Jay
... more >>
How can I combine 2 SELECT statements into 1 ?
Posted by Gilbert at 4/11/2006 8:07:03 AM
Please consider the following SELECT statements; is it possible to combine
them into a sole SELECT statement returning 4 columns ? Thank you.
SELECT YEAR(DhEnregistrementIntervention) AS ItvNumAnnee
, MONTH(DhEnregistrementIntervention) AS ItvNumMois
, COUNT(NumIntervention) AS ItvQteDemande
... more >>
SQL Server Maximum rows in a table
Posted by Jportelas at 4/11/2006 8:07:03 AM
Hi there:
I´m currently working on an ROLAP SQL Server based cube, and I have a
"details" fact table that can become really big and I would like to know what
is SQL Server 2000 maximum rows in a table limit, can anybody help me with
it?
I would also like to know if there are any withdr... more >>
SYSTEMUSER in green, SYSTEM_USER in pink
Posted by Alain Quesnel at 4/11/2006 7:30:46 AM
Does anyone know why SYSTEMUSER appears in green in Query Analyzer? I can't
find anything about it in the online help or in Google.
Thank you,
--
Alain Quesnel
alain@logiquel.com
www.logiquel.com
... more >>
Newbie Locking question
Posted by DrewV at 4/11/2006 7:24:02 AM
How many lock requests is too many? To explain, we have a customer who is
reporting some slow performance problems and he says that performance monitor
is recording an average of 30 million lock requests and he thinks this is
excessive. So I guess my real question is, is he right, is this exc... more >>
How do I get the UserID column value of the User that just has been created from aspnet_Users table in aspnetdb?
Posted by Learner at 4/11/2006 7:08:42 AM
Hello,
I am using CreateUserWizard server control in VS 2005 to create new
users on our
website. The creation of New users process is smooth and I have no
problem with it. But we have a need to create (store) a value called
DealerShipID in another table called Users in our database (not in t... more >>
problem with a stored procedure
Posted by ina at 4/11/2006 6:58:30 AM
Hello guys,
I have again problem with a stored procedure in sql server.
I would like to execute this query
declare @sSQL varchar(255)
SET @sSQL =
'SELECT TOP 1 [value], date, name, [times]
FROM (SELECT value, date, times, name
FROM view... more >>
problem with a stored procedure
Posted by ina at 4/11/2006 6:55:43 AM
Hello guys,
I have again problem with a stored procedure in sql server.
I would like to execute this query
declare @sSQL varchar(255)
SET @sSQL =
'SELECT TOP 1 [value], date, name, [times]
FROM (SELECT value, date, times, name
FROM view... more >>
Row numbering unpredictable
Posted by cseemeuk NO[at]SPAM googlemail.com at 4/11/2006 4:30:17 AM
Hi,
I need to create a stored procedure that returns the row number (for
paging) AFTER the data has been sorted with an order by. The source is
a view. The code I have is:
SELECT rownum = IDENTITY(1,1,bigint), *
INTO #tmp
FROM viewName
ORDER BY CustomerName -- field name I'm ordering by... more >>
Problem in sql function declare variables
Posted by ina at 4/11/2006 3:24:47 AM
Hello guys,
I have this function:
CREATE Procedure sp_list
@fund_name varchar(255),
@StartDate DateTime,
@EndDate DateTime
AS
BEGIN
declare @sSQL varchar(255)
set @StartDate = getdate()
set @EndDate = getdate()
SET @sSQL = 'Select value, max(time) as maxdate
As query
INT... more >>
Update datetime field bug??
Posted by patch79 at 4/11/2006 3:17:02 AM
In a stored procedure I check to see whether the clients comments that are
passed are different than what is in the database, if they're different i set
the ClientNoteDate using GetDate(), otherwise i update the table with the
existing ClientNoteDate. For some reason, occassionaly when the co... more >>
Some basic questions
Posted by Water Cooler v2 at 4/11/2006 2:49:53 AM
I've not touched SQL server programming since 1999. I have very little
memory of it and need some clarifications on some basic questions that
I could even use a book for. Until I get myself a good book, someone
please help me with the answers:
1) What are SQL functions and how are they diffe... more >>
Clearing all the data from a database
Posted by Craig HB at 4/11/2006 2:31:02 AM
I am looking for an easier way to clear all the data from a database.
I tried "TRUNCATE TABLE", but this didn't work because of the foreign key
constraints.
Thanks,
Craig... more >>
Need help with a max query
Posted by ina at 4/11/2006 2:30:16 AM
Hello guys,
I have this view:
SELECT MAX(DERIVEDTBL.[Time]) AS Time, DERIVEDTBL.[Value],
DERIVEDTBL.Date, MIN(DISTINCT DERIVEDTBL.Name) AS name
FROM (SELECT *
FROM f_view -- another view
WHERE ... more >>
Audit trail - Sql Server 2000
Posted by SSUK at 4/11/2006 2:27:02 AM
Hi,
Greetings to all.
We are building up a new application using SQL Server 2000 & .NET.
Need to build basic “Audit trail†process, in which need to store {User_Id/
DateTime/ Status/Process Name}.
What’s the best strategy for implementing “Audit trail†in SQL Server 2000
Appl... more >>
selecting multiple rows from remote sp call
Posted by Park Kyungjae at 4/11/2006 1:33:58 AM
greetings, I'm Kyungjae. this is the first posting in this group.
now i'm in struggle to solve this problem..
i wanted to select multiple rows from remote db server, with some
filtering.
here's my scenario:
in DbServer001, i made an sp in tempdb:
----------------
use tempdb
GO
CREATE PR... more >>
insert record for 1 to 100000
Posted by joe at 4/11/2006 12:55:02 AM
how to create record from 1 to 100000 in sql... more >>
Bulk Insert XML?
Posted by Rakesh at 4/11/2006 12:46:02 AM
Is there a way to import a large XML file into SQL Server 2000/2005 using
T-SQL?
Looking for some utility like Bulk Insert/bcp...
- R... more >>
|