all groups > sql server programming > july 2004 > threads for friday july 9
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
Object already exists msg -creating temp table
Posted by chinnad at 7/9/2004 11:42:01 PM
I am creating a temp table in side a "IF" statement in a Steored Proc
which looks like this .
IF a = b
begin
create table #temp
end
else
begin
create table #temp
end
I am not able to compile the SP as the error being "The object #temp already e... more >>
Losing zeros from csv during inmporting to sql server
Posted by Ashish Kanoongo at 7/9/2004 9:03:10 PM
Hi,
I have the foll csv file
01,12111
02,14155
05,11011
10,00114
34,00001
03,11000
I have the following code that parse the text file and and import in sql =
server table, it import perfectly except it is removing leading zeros so =
01 is returned as 1. Why?
With Con1
.... more >>
End User Requirements
Posted by Jonathan at 7/9/2004 8:41:03 PM
I am think about using SQL Server as the database for my application. Would my end users have to own and have SQL Server installed? Acess databases will run without having Access installed. Do SQL databases work the same way? Thanks for the help.... more >>
Creating Multiple Indices on a Table
Posted by David C. Holley at 7/9/2004 8:08:44 PM
I'm quite new to SQLServer and I have a question about indexes. I
understand the logic behind creating index and some of the thinking that
should be used when decided upon which columns to index, however I don't
understand where the existance of multiple indexes on the same table
comes into ... more >>
How to check Character Set ??
Posted by tristant at 7/9/2004 5:55:25 PM
Hi All,
I want to know what character set used by SQLServer2000, so I run
sp_helpsort and ServerProperty('Collation'), below is the result :
sp_helpsort =>
----------------------------
Latin1-General, case-insensitive, accent-sensitive, kanatype-insensitive,
width-insensitive for Unicode D... more >>
Zipping the big database.
Posted by guess at 7/9/2004 4:40:25 PM
What is your guess if we zip about 2GB database (backup
file), what would be the size of the zipped .bak (.zip)
file.
Before that, is it possible to zip using Winzip or some
other utility to zip such a big file.
The reason I want to .zip because someone has to send me
the datbase on CD... more >>
data dictionary procedure
Posted by Yeager Simpson at 7/9/2004 4:18:49 PM
Hi, i'm working on a stored procedure for any single database which will
list out the table name, column name, data type, column length, and
description for each table and its rows. I follow from some other posts to
add these separately: the INFORMATION_SCHEMA.COLUMNS and
fn_listextendedproperty... more >>
Creating EXCEL using DTS.
Posted by PVR at 7/9/2004 4:16:21 PM
Hi Sql Gurus.
We get the montly reports by executing the Sql Queries, by
copying the result set
from query analyzer to excel sheet.
Next task is we will format the excel sheet by removing
the Nulls, set the font size,
align the width of each cell bold the header etct etc.
I know t... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Puting password on Excel file created by DTS
Posted by Jonathan Blitz at 7/9/2004 3:28:15 PM
I am creating an Excel file from DTS.
Problem is I need to add a password to the file after it is created - how
can I do this?
--
Jonathan Blitz
AnyKey Limited
Israel
"When things seem bad
Don't worry and shout
Just count up the times
Things have worked themselves out."
... more >>
SQL query "too long"?
Posted by Griff at 7/9/2004 3:18:37 PM
Hi
I have a whole series of databases with exactly the same schema all on the
same SQL Server (2000 sp3a).
I've written a cursor that gets all the database names from the master
table.
I iterate through the cursor's list of databases. I have a variable
@sqlStatement AS NVARCHAR (4000) t... more >>
SQL View - Parent/Child
Posted by Joe Williams at 7/9/2004 2:51:45 PM
I have an SQL2000 Bill of Material table (dbo_BOM) that has the fields of
Parent, Child, QuantityPer.)
We have many multi-level products where the Parent number is also a child
number in another record. There may be up to 6 levels deep of this
relationship
I would like to make sn SQL view t... more >>
Selecting Data in a While Loop
Posted by Lucas Tam at 7/9/2004 2:17:57 PM
Hi all,
I have a WHILE loop that looks like this:
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT @CampaignName, @CampaignID
FETCH NEXT FROM CampaignList INTO @CampaignName, @CampaignID
END
How do I Select the data all into one Result Set? Each iteration of the
while loop creates a ne... more >>
Help from Gurus with SQL query
Posted by Chumma Dede at 7/9/2004 2:00:51 PM
Hi,
When I run the following query:
Select
vcname,
convert(varbinary(16),vcname),
len(vcname)
From Temp1
I get the following result:
DUMAS 0x44554D4153000000000000000000 14
DUMAS 0x44554D4153 5
Any idea how I can group these two records by ignoring the hidden characters... more >>
Not a trusted connection
Posted by Denis Crotty at 7/9/2004 1:49:01 PM
Hi,
We are in the process of moving our development site to a production box. Today I tried testing it and my database connections fail.
I get:
Microsoft OLE DB Provider for SQL Server (0x80004005)
Login failed for user ''. Reason: Not associated with a trusted SQL Server connection.
n... more >>
SQL Selection by date
Posted by Peter Newman at 7/9/2004 1:34:02 PM
i have a table with a smalldatetime field . how can i do a delect on the field to return all records with a recieveddate = getdate
ie
select * from table1 where Recieveddate - Getdate()
Thanks... more >>
UNION query
Posted by ndatt at 7/9/2004 1:07:01 PM
I'm trying to do a UNION qry but am getting a syntax error on the union. I'm not sure why but seems to be something due to the order by. I'm trying to union a list of the top 5 companies and their premium with the subtotal premium of all the other companies. Any ideas would be helpful.
SELECT... more >>
Fastest way to load a text file into a table
Posted by martino at 7/9/2004 12:54:58 PM
Hello There!
I am trying to find out what is the fastes way to load a
text file containing 3,876,240 rows into a table that
contains the same column definition.
Before I did it table to table and it took 1hr 8 min,
there is gotta be a faster way to do it.
I am using DTS for these oper... more >>
How to Execute SP based on Date/time
Posted by AutomateScada at 7/9/2004 12:34:02 PM
I created a SP to delete unwanted data from a table. I need to execute the SP each nite. Can this be triggerd/executed automatically somehow?
Mike... more >>
problem using sp from vb program
Posted by Dan D. at 7/9/2004 12:27:02 PM
Using SS2000 and VB6. I'm getting this error when debugging the VB program: Parameter object is improperly defined. Inconsistent or incomplete information was provided.
Here's part of my VB code:
' check for duplicates
' Set up a command object for the stored procedure.
Set cmd... more >>
Pramererized Stored Proc returning error when run from vb.net code
Posted by Anand Sagar at 7/9/2004 12:11:08 PM
I created a stored procedure
create proc getcontact @acno varchar(30)
as
select * from contact1 where accountno = @acno
When I execute this sp in the Query Analayser like this
getcontact '95112933591388844Gab'
it works.
But when I try to execute from my asp.net code,
Dim Co... more >>
column coming in NULL from excel
Posted by Alex at 7/9/2004 11:55:23 AM
Hi;
I am using the following to get the data from Excel into a db table, but for
some reason the Zip column (defined as nvarchar(64)) is coming in NULL for
non-numeric Zip Codes....
Your insight is appreciated!
insert into dbo.sys_load (FirstName, LastName, Address, City, State, Zip,
Count... more >>
Job Step with SELECT statement (Time Out)
Posted by Mark at 7/9/2004 11:51:58 AM
I have a multi step job that runs and one of the steps is
a SELECT statement. The step after the SELECT statement
depends on the output from SELECT statement.
What is the amount of time that a select will run without
return the values?
Thanks
Mark
_______________________________... more >>
Ignore Index on Indexed field
Posted by Mark at 7/9/2004 11:04:33 AM
Is there a way to ignore the index on field that has index
within a SQL statement?
Within Oracle this can be completed.
Example listed below.
Index field Number:
SELECT * FROM class WHERE number = 30;
Ignore the Index
SELCT * FROM class WHERE number+0 = 30;
Please help me with ... more >>
subquery problem, wrong reference in the subquery?
Posted by microstone NO[at]SPAM hotmail.com at 7/9/2004 10:58:41 AM
In the following example, the t2 table doesn't even have that keyID
field. The query still runs and give out results.
Why? Is this a known bug?
/*
create table t1 (rowid int primary key, keyid int, rowname
varchar(100))
create table t2 (rowid int primary key, rowname varchar(100))
ins... more >>
SELECT statement (Time Out)
Posted by Mike at 7/9/2004 10:53:35 AM
What is the default amount of time that a SELECT statement
will wait before it errors without returning data?
Can this wait time be specified in a SELECT statement?
Does this wait time take into a count that a table is
blocked?
Thanks,
Mike... more >>
http calls from stored procedure
Posted by Fredrik Breine at 7/9/2004 10:44:43 AM
Hi,
I was wondering if anybody knows if it is possible to make http calls from a
SQL Server 2000 stored procedure.
Any info would be greatly appreciated.
Thanks!
Fred
... more >>
After Insert, Goes to Last Record
Posted by Gerard at 7/9/2004 10:43:05 AM
Hey all,
I am running SQL 2k with Access 2k. I am using SQL
Server with Access as the front end for the forms. I have
code in Form_AfterUpdate that forces a Recordset.Requery
when a record is added so that the record just added
appears in the recordset with it's joins, and thus appear... more >>
SelectingNewestRecord
Posted by rj at 7/9/2004 10:43:01 AM
I have a view that returns data from several tables I am trying to
select the newest records from. Below are the fields;
TransID TransDate ExpDate TransType CustID
1 01/01/2003 01/01/2004 4 1
2 01/01/2003 5 ... more >>
Need help with WHERE clause for string matching
Posted by JT Lovell at 7/9/2004 10:27:21 AM
Background:
I'm writing a stored procedure that parses out name components from an =
email To, CC, BCC, and Author columns and then uses those name =
components to determine which existing contact rows should be related =
and then creates the relationship. I have the logic worked out for =
e... more >>
automatic sql server backup to networked machine
Posted by dmalhotr2001 NO[at]SPAM yahoo.com at 7/9/2004 9:55:11 AM
Hi,
I am currently backing up to my machine on my localbox of the database
I want with enterprise manager.
I would like to do an automatic backup of my database running on a
schedule on a networked shared/remote machine?
How do I do that?
Thanks,
:DHRUV... more >>
Create View with SchemaBinding to tables in another database.
Posted by Craig Kenisston at 7/9/2004 9:46:22 AM
Is this possible ?
I have db chaning turned on, and I can succesfully create views to tables
that are in other database without having to setup permissions to the
underlying tables.
But, now I need some of the views to be created with SchemaBiding so I can
create indexes on them.
When ... more >>
Boolean Naming Conventions
Posted by news.microsoft.com at 7/9/2004 9:35:25 AM
Greetings,
I am posting this message to both the SQL Server and C# news groups
because this inquiry is more of a theoretical question that applies to both
database and code naming conventions.
I have currently been prefixing boolean object properties and database
columns with Is .. for ex... more >>
group by question
Posted by Melounjan at 7/9/2004 8:49:32 AM
How can I use group by to filter below rows and show below
result?
col1|col2
1|a
2|a
3|a
1|b
2|b
result:
col1|col2
3|a
2|b
So, I need to see only max of col1.
Thanks..... more >>
Deadlocks
Posted by Brian Shannon at 7/9/2004 8:32:42 AM
I am running a program and an error keeps coming up saying it encountered a
deadlock and was declared the victom. I am running sql 2000 server.
How can I determine what is causing the deadlock to cancel the transaction?
Any suggestions would be appreciated?
Thanks!
... more >>
How can I control execution wait time within a stored procedure?
Posted by Ken Sturgeon at 7/9/2004 8:22:33 AM
I have a COM object that I instantiate from a stored procedure using the
sp_OA* system procedures. The COM object establishes a connection to an
AS400 system, invokes a process and returns the output from the AS400
process. Everything works as expected but I fear that there will be times,
hopefu... more >>
Stored Prcedureworks locally, not remotely
Posted by Wex at 7/9/2004 6:44:11 AM
I have a stored procedure which queries and inserts
information on a local server and a linked server.
When you use the query analyzer to EXEC SP### it works
fine.
When the programmers try to execute it from their
application, the query runs for a long time and chews up
resourses on th... more >>
Getting Current Date in a SP
Posted by Wayne Wengert at 7/9/2004 6:43:30 AM
I want to get the equivalent of NOW() within a stored procedure. I have not
been able to find the correct syntax to do this. Can anyone point me to
information on how to accomplish this? I looked through BOL but am not
finding it.
Wayne
... more >>
Return position of character
Posted by PLSH at 7/9/2004 6:19:01 AM
Hi there,
Does anyone know the SQL Query analyser equivalent of VB's instr? VB sample code:
sInput = "1,2,3"
sOutput = InStr(1, s, ",")
the result would be that sOutput would be filled with 2, indicating the position of the comma is 2. I need to do a similar thing with a SQL statement in SQL... more >>
Case When - seeking equivalent or Work Around
Posted by LEB at 7/9/2004 5:33:02 AM
I’m struggling with â€Case When†and can’t find a Workaround or other Select statement. Please give me suggestions of what to do!
This works:
SELECT dInvoice.nInvoiceNo, dInvoice.nSeason, dInvoice.cOurRef, dInvoice.cYourRef, dInvoice.cInvoiceText, dSupplierInvoiceHead.cVatNo,
'Vat1' =
... more >>
Problem with Where . . . . In clause
Posted by PLSH at 7/9/2004 4:58:01 AM
Hi there,
I have the following code:
Declare @pTest nvarchar(200)
set @pTest = '1,2,3'
SELECT Col1
FROM Table1
WHERE Col1 IN (@pTest)
I get the following error:
Syntax error converting the nvarchar value '1,2,3' to a column of data type int.
Now Col1 is an integer but as soon as I d... more >>
stored procedure
Posted by JIM.H. at 7/9/2004 4:50:34 AM
Hello,
I have a csv file: c:\tmp\myfile.csv which has thee
column: lastName, firtsName, Age.
Now I want to import this data nightly to a table: myTable
which has the same columns in SQL Server. I am quite new
in SQL server, can someone write me a stored procedure to
accomplish this?
Thank... more >>
use guid for primary key
Posted by jenson at 7/9/2004 4:47:57 AM
guru,
I have 200 tables. I plan to write a osql to add an additional column using
the guid for primary key for each table.
question:
what is the SQL command to create additional column and using guid for
primary key?
Any help is much appreciated.
Jenson
... more >>
A simple Trigger question
Posted by Paul in Harrow at 7/9/2004 1:55:02 AM
Hi there,
I'm totaly new to SQL so please bear with me.
I have set up three identical tables (CoursesADC, CoursesLD and CoursesAll with field names CourseCode, CourseTitle, Medium, ExpectedHours etc) and I want to put a trigger(s) on the ADC & LD tables that update the All table whenever a record ... more >>
patindex
Posted by Beeeeeeeeeeeeves at 7/9/2004 1:27:02 AM
how well does the patindex function compare to a regex in terms of functionality/power?... more >>
Partitioned views
Posted by verbani at 7/9/2004 1:21:02 AM
Hi,
i'm having some problems with partitioned views.
When I create the following view there is no problem.
CREATE VIEW dbo.Fact_SC_Orders_Vw
AS
SELECT Fact_Id, BC_ID, Cust_ID, ir_key, SC_Ord_H, SC_Ord_L, SC_Inv_H, SC_Inv_L, It_No, Line_Qty, LCUR_Line_Val, LCUR_Line_ListVal, LCUR_Line_... more >>
SQL batch
Posted by kalle anka at 7/9/2004 12:05:32 AM
How do I get simple Queries (Insert, Update and Delete)
to run automatic at a specific time (MS SQL 2000 server).
If I put them all in Query Analyzer they work fine, all
togehter.
Must I have them in separate procedures?
The SQL contains about 70 000 characters and consists of
about 100 dif... more >>
|