all groups > sql server programming > august 2004 > threads for friday august 6
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
Update with dates
Posted by Aleks at 8/6/2004 11:41:39 PM
This could be an easy one
I have a table with 3 fields as follows:
1) Userid - int (This is the key identity field)
2) I94Date - varchar
3) I94DateD - smalldatetime
I SEE TWO OPTIONS FOR WHAT I NEED: OPTION # 1
I need to update the I94Date for all the table, so that for record # 1 the
... more >>
compare the data of 2 tables are identical
Posted by Matt at 8/6/2004 10:59:36 PM
I have 2 tables in 2 different databases, and I want to compare the data of
2 tables if they are identical. 2 table structures are identical.
Here's my attempts:
SELECT * FROM DB1..TB1 WHERE NOT EXISTS (SELECT * FROM DB2..TB2);
If both tables have identical data, it will return no rows.
A... more >>
merging tables using union
Posted by Bernie Yaeger at 8/6/2004 7:35:14 PM
What's the correct t sql syntax for merging 2 tables (same structure) into
one, either a new table using something like 'select... into' or either of
the existing tables? The tables have, respectively, 701 rows and 11 rows -
the new or replacement table should have 712 rows.
Thanks for any he... more >>
VS2005 beta1 and SQL 2005 beta2
Posted by Mark Goldin at 8/6/2004 7:01:41 PM
Will these two programs work together?
... more >>
Bulk copy operations using SQLDMO
Posted by Yannis Makarounis at 8/6/2004 5:58:41 PM
I have written some code doing bulk copy operations from inside my
application using SQLDMO. It works fine but I have the following questions :
1. When importing a data file created by the ExportData operation is it
possible to specify a table that does not exist in the DB and which will be
crea... more >>
casesencetive
Posted by Viktor Popov at 8/6/2004 5:27:51 PM
Hi,
I would like to ask if someone knows how to make a column in which I store
passwords CASESENCETIVE?
Thank you in advance!
Viktor
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.729 / Virus Database: 484 - Release Da... more >>
xp_cmdshell
Posted by TimS at 8/6/2004 5:17:01 PM
Can anyone point me in the right direction for getting detailed information
on how to use the xp_cmdshell stored procedure for copying files on a
corporate network between two computers which are not SQL servers? I have
read all of the discussion threads regarding the xp_cmdshell and have gle... more >>
Fixed-text padding task
Posted by Mekkala at 8/6/2004 4:36:14 PM
I'm looking for utility similar to this one:
http://www.databasejournal.com/features/mssql/article.php/1462341
.... but for SQL Server 2000.
Basically, I'm having trouble importing a fixed-width text file because
when trailing columns are blank, the rows are not padded. In other words,
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
replicate?
Posted by JT at 8/6/2004 4:30:07 PM
i have a bunch of data that has various numbers of preceding zeroes - can
someone help me with a query that will trim off all leading zeroes. i know
how to use the replace function, but my problem is that sometimes there are
five leading zeroes, sometimes one, or none, etc.
example of data an... more >>
help needed on a stored procedure - web report
Posted by Goober at christianDOTnet at 8/6/2004 4:13:08 PM
I generate a report in a web browser calling a sql 2000 stored procedure.
There are no joins or anything fancy within the stored procedure, but I've
been asked to do something I'm not sure how to do.
The stored procedure is generated from a table that has last year's and this
year's data for... more >>
Ask for the comment for showing the structure of Table
Posted by Ray at 8/6/2004 4:12:06 PM
Hi all,
I am a new user of SQL database. I would like to ask the comment for
showing the structure of Tables in the SQL Analyzer.
Thanks a lot,
Ray
... more >>
Access to SQL
Posted by Jack at 8/6/2004 3:54:41 PM
We ran this query in Access to get a pivot table in Excel. Now the DB was
tranferred to SQL-server and we cannot convert the query to SQL. Any help?
Outstanding: Choose(Int(DateDiff("d",mktable.DispDate,Date())/30)+1,"<30
days","30-60 days","60-90 days","90-120 days")
Thanks
... more >>
Help: TSQL loop or array
Posted by ricard at 8/6/2004 3:29:23 PM
Hi,
I want to make samething like this in TSQL (SQL server 2000)
array colname('col1','col2','col3')
SET SQLstring='CREATE TABLE ('
foreach (colname as cname)
{
SET SQLstring=SQLstring+cname+' varchar(20),'
}
SET SQLstring=SQLstring+')'
EXECUTE sp_executesql @SQL
so is possibl... more >>
Newbie Question - Creating Triggers within Stored Procedures
Posted by anonymous NO[at]SPAM discussions.microsoft.com at 8/6/2004 2:23:59 PM
I have a migration procedure that fires off dozens of other stored procedure
to create tables, relationships, etc. Can I also create triggers on those
newly-created tables by using those same procedures? I tried syntax similar
to below, but it of course didn't work.
Thank you
\\\
ALTER P... more >>
Calculated Fields in Tables
Posted by gkrugb NO[at]SPAM yahoo.com at 8/6/2004 2:04:14 PM
I would like to be able to have a different formulas in each row of a
table. Right now I use a cursor and select each formula and execute
the select and insert values into a table, does anyone know a better,
quicker way of doing this??
Thanks in Advance.
G.... more >>
Query tuning issues.. not using the right indexes and hence very slow in running
Posted by Nags at 8/6/2004 1:47:52 PM
I have a query tuning problem. I am putting in all the data structures,
queries, execution plan. Please help me in turning the query. All feedback
is appreciated.
-- Table 1
CREATE TABLE DIM_ENTITLEMENT (
ENTITLEMENT_ID numeric(18, 0) NOT NULL,
... several other columns
CONSTRAINT DIM... more >>
Permission question - another one
Posted by Thomas Scheiderich at 8/6/2004 1:34:30 PM
In Sql Server 2000
I am tfs as a user and login.
I have no server roles.
I have no access to the vdw database (dbo is sa).
If, using query analyser, I try to connect, using Sql Server
Authentication - I cannot connect to vdw (can't issue "use vdw" or choose
vdw from the drop down box) ... more >>
Which is FASTER?
Posted by Prabhat at 8/6/2004 1:25:23 PM
Hi All!
If I have QUERY like this then which will be faster?
SELECT A.COL1, A.COL2, B.COL2, B.COL3
FROM TAB1 A INNER JOIN TAB2 B ON A.COL1 = B.COL1
WHERE B.COL5 = 'VAL1'
AND
SELECT A.COL1, A.COL2, B.COL2, B.COL3
FROM TAB1 A, TAB2 B
WHERE A.COL1 = B.COL1
AND B.COL5 = 'VAL1'
Both ... more >>
ORDER BY requires TOP
Posted by David Lozzi at 8/6/2004 12:42:18 PM
The ORDER BY clause is invalid in views, inline functions, derived tables,
and subqueries, unless TOP is also specified.
So I insert it here:
SELECT TOP 100 var1, var2
However, i want to return all the rows, I can't seem to do 100% because % is
a wildcard. How do I get around this?!?!?!
... more >>
isql /o - how to suppress column header / feedback
Posted by CookeOH at 8/6/2004 12:41:01 PM
I need to extract data from SQL Server. I am using ISQL command line utility
to output query results to a file --> isql /o. I would like the file to
contain data only, no column header, and no feedback. What is the SQL Server
syntax to suppress the column header / feedback data? The Oracle... more >>
SQL Sored Procedures
Posted by Prasad at 8/6/2004 12:36:24 PM
Hi
I would like to now wheather we can pass Arrays to SQL
Procedure and will it handle .I am trying to execute from
a different application
Thanks ... more >>
The Query Designer does not support the CASE SQL construct.
Posted by David Lozzi at 8/6/2004 11:50:44 AM
What can I use instead of CASE?
Thanks,
--
David Lozzi
Web Applications/Network Specialist
Delphi Technology Solutions, Inc.
dlozzi(remove-this)@delphi-ts.com
... more >>
ASP developer sought !
Posted by mark tate at 8/6/2004 11:43:55 AM
ASP Developer/Company who has experience in Java Script and Microsoft
SQL Server sought urgently for ongoing contract work.
Initial template website 95% finished, but current developer can no
longer afford to provide enough dedicated time, and would not be able to
develop the other 35 clone ... more >>
Drop all user tables + ignore constraints
Posted by dw at 8/6/2004 10:57:23 AM
Hello, all. We need to drop all user tables in a SQL Server 2K database all
at once with a piece of code. However, many of the tables have foreign key
relationships, and it gives errors until we drop the constraints. Any way to
drop all constraints on all user tables, and then drop all user table... more >>
Retrieving XML with HTTP within stored procedure ...
Posted by Richard Weerts at 8/6/2004 10:23:29 AM
Within a stored procedure, I need to retrieve XML over HTTP from an external
URL, then load some stuff into a recordset and return as such.
Like this, sort-of:
-- *******************************
create procudure queryremote (@param)
declare @xmldoc varchar(2000)
set @xmldoc = (GET 'HTT... more >>
Convert
Posted by Kathy at 8/6/2004 10:22:12 AM
I have written the following query to show me records
where the last character for the data field is a number,
if its not a number, then it shouldn't retrieve that
record.
I am getting errors since for some records the last value
isn't a number, it could be any alpha like 'a','b', etc.
Ho... more >>
Formating Numbers
Posted by Tor Inge Rislaa at 8/6/2004 9:28:04 AM
With the query (SELECT MyNumbers FROM MyTable) I get a list looking like
below.
2,75
16,28
0
2,86
0,506
26,18
0
I would like to format the output with a fixed number of digits as below
2,75
16,28
0,00
2,86
0,51
26,18
0,00
How is that possible?
TIRislaa
... more >>
Exporting data to Excel File
Posted by fdde at 8/6/2004 9:10:05 AM
Hi,
I am using VB 6.0 and SQL Server 2000 for developing a custom project. I
would like to know if it is possible to use a transact SQL statement to
export data stored in a recordset to an Excel file. Something like:
' Get Excel filename in FileIn
Dump Recordset into FileIn ' Recordset co... more >>
Select * From clause
Posted by Brian at 8/6/2004 9:07:01 AM
Hi, all,
what's different between
select *
from tableA, table B
where TableA.a1 = tableB.b1
and
select *
from TableA join tableB on TableA.a1 = tableB.b1
Which one is better?
Thanks
Brian... more >>
Stored procedure call with parameter
Posted by Michael Welz at 8/6/2004 8:50:59 AM
Hello NG,
i try to call a stored procedure with parameter frm anotherone lite that:
....
and
ObjSnr in ( exec sp_FEWO_hole_Kriterien @Kriterien )
....
But it dosn works...where is teh error
Thanks Michael
... more >>
A question on SQL Query: SELECTing column names
Posted by Cyont at 8/6/2004 8:50:49 AM
Hi,
I need both column names and data. So is there a way to SELECT column names
along with the stored record for each column? I know we can do that as
"AS", but since somehow this table has more than 30 columns, I don't feel
like doing them one by one.
Cyont
... more >>
Position
Posted by John at 8/6/2004 8:41:22 AM
I have 3 fields REF, ID and OFFER
REF is the id of a article
ID is the ID of the client
OFFER is a offer made by the client
Now some of the clients wonder on which position they are in the list of
offers.
Suppose
Art, Id, Offer
888, 100, ?55.00
888, 108, ?67.30
888, 145, ?52.70
888,... more >>
TSQL stud needed in Pasadena, Ca. area
Posted by ChrisR at 8/6/2004 8:39:48 AM
The company I work for is in need of a Senior level SQL
coder/ report writer. Must know your way around derived
tables, subqueries, etc. Must be able to perform
aggregations from multiple tables. If you are still @ the
temp table/ cursor level don't bother to apply. (Of course
sometimes th... more >>
ORDER BY CASE failure on Computed Field
Posted by charles at 8/6/2004 8:35:31 AM
I need the end-user to be able to select which column of data to sort by and
the suggested implementation is with a CASE statement inside the ORDER BY
clause.
The following fails with "Invalid column name 'NumPosts'" when I try to
include it in a stored procedure
DECLARE @SortCol char(40);
... more >>
Bulk insert..
Posted by Yaheya Quazi at 8/6/2004 8:22:56 AM
Hi Please review my query below
INSERT INTO employee
(emp_full_name, emp_first_name,
emp_middle_name, emp_last_name, emp_suffix_name,
address_line1, address_line2, address_city,
address_state, address_zip,
work_addr_line1, work_addr_line2, wor... more >>
Gettig the count of lowest level
Posted by Stanley at 8/6/2004 8:17:01 AM
Hi,
I want to retrieve a count of a level.
All Region (1st level)
Asia (2nd level)
China (3rd level)
Singapore
Taiwan
Europe
Belgium
France
Spain
Italy
America
Canada
US
Depending on where i stand i want the coun... more >>
TimeZone Info from Windows Registry
Posted by Prasad Bhogadi at 8/6/2004 7:22:52 AM
Hi,
I have a situation where I need to retrieve the TimeZone
info
using 'HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Time Zones\
I should be able to read all the Time Zone info along with
the offsets and Daylight saving details.
Is this accomplishable in T-SQL us... more >>
Exceptions in CRecordset
Posted by Sameer at 8/6/2004 6:27:02 AM
Hi,
I have written a software which spawns threads depending on the type of
message this software receives. In each of the threads I connect to database
and fetch records and then I use the fetched records to insert into another
database. After writing to database the thread returns. The thi... more >>
"distinct" keyword use in sql queries
Posted by subdueme NO[at]SPAM hotmail.com at 8/6/2004 2:46:08 AM
Hi!
Is there any kind of worry when using the keyword "distinct" in sql
commands for querying DB Sqlserver 8??
Some people higher experienced than me in vb.net apps development told
me not to use "distinct" but they mentioned no reason for that...
I´m struggling to not use "distinct"... Is th... more >>
Update Statement for Datamart???
Posted by Steve at 8/6/2004 12:22:29 AM
Hi,
I am building datamart but I need your expert advise to
update the datamart.
I get text file & load it into Staging Table. From
Staging Table I load it into Dimension table
Cust_Staging_Table
Cust_id Cust_Name Cust_Add Cust_City
111 Sam 100 St. San Jose
222 ... more >>
Any one heard of the command ":r"
Posted by Buddy at 8/6/2004 12:05:08 AM
Has any one heard of the command :r?
If so could you explain which version it's supported
under and how to use it.
I believe it allows you to include scripts.
Thanks,... more >>
|