all groups > sql server programming > november 2005 > threads for friday november 25
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
query help
Posted by Hassan at 11/25/2005 10:16:47 PM
I need a query to give me dbname, tablename,rowcount,size for all user dbs
and tables on a server
I know i can use sp_spaceused.. But want a query that I can then run on any
server
Thanks
... more >>
Table Name
Posted by Justin at 11/25/2005 6:38:05 PM
Hello,
I am new at programming using a SQL Server back-end and it hasn't taken me
long to run into some trouble...any help would be appreciated.
When tables are imported by users, the table names are
[username].[tablename] (for example, Jennifer.tblCustomers)...when I try to
reference th... more >>
howto sp_adduser
Posted by Abraham Andres Luna at 11/25/2005 5:40:08 PM
hey everyone,
i managed to sp_addlogin:
sp_addlogin 'ID', 'PWD', 'ad_2000'
then i tried to sp_adduser:
sp_adduser 'ID', 'ID', 'sysadmin'
and it threw an error: sysadmin does not belong to database
i assume that i should have set the database to master
but would that affect any acc... more >>
How to get the most new value registered...
Posted by Myriam Cerda at 11/25/2005 4:56:18 PM
I have this information,
header table
documento fecha_entrada
100000 2005-11-25
100001 2005-11-25
100002 2005-11-26
detail table
documento linea numero_producto fecha
100000 1 X 2005-11-25 10:00
100000 2 ... more >>
Getting value from SP
Posted by SalamElias at 11/25/2005 12:57:34 PM
I have a stored procedure with one param and gives me one result. It takes a
SKU varcahr and sends back it's price (I don't use output param).
I need to call this procedure from within another procedure several times
(cursor loop), something like this
mycursor fetch @sku
set @myprice = exec m... more >>
using variable with INSERT INTO statement
Posted by j at 11/25/2005 12:41:25 PM
Hello, I would truly appreciate any help. I am stuck on how to use a value
returned from a query, assign it to a variable and used it with the INSERT
INTO clause to insert values from one table to an object name dynamically
rendered to a variable. Is that possible?
For example:
--n... more >>
Failing inner join
Posted by W.Meints at 11/25/2005 12:39:11 PM
I am trying to get an overview of non-planned items using the following query:
SELECT dbo.ProjectTasks.TaskId
FROM dbo.ProjectTasks INNER JOIN
dbo.PlannedItems ON dbo.ProjectTasks.TaskId <>
dbo.PlannedItems.TaskId
The query should select those records from... more >>
SQL dateadd
Posted by Dave at 11/25/2005 11:21:05 AM
SELECT DATEADD(month, 1, '2005-05-31')
GO
SELECT DATEADD(month, 1, '2007-01-31')
GO
SELECT DATEADD(month, 1, '2008-01-31')
GO
SELECT DATEADD(month, 1, '2005-06-30')
GO
All of the above gives me the expected result except for the last one.
The last select statement returns '2005-07-3... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Execute SQL based on number rows in two tables
Posted by Pasha at 11/25/2005 10:46:01 AM
I have a table that I would like to backup each morning only if the number of
records in this table is greater than in another table. How can achieve
this? Basically, I would like it to be like this:
IF (rowcount in A) > (rowcount in B) then
Execute SQL
ELSE --NOTHING
END IF... more >>
Dynamic Sql Intermittenetly Slow - Losing Hair Fast
Posted by lad4bear NO[at]SPAM gmail.com at 11/25/2005 10:40:29 AM
Hi guys,
I've been staring at this stored proc for hours and I just can't see
what wrong with it. It will run fine 40+ times in a row and then one
time it it will take up-to 15 seconds to complete. Am baffled.
Anyway here's the query. It basically says, select all the hotel rates
where the ... more >>
What backup files do I need to keep?
Posted by mizi at 11/25/2005 9:51:09 AM
Hi. Currently, I do daily full database backup and hourly trans log backup,
so the system will generate many files, I don't know what files should I
keep?
eg, there are following files in my server:
cardata_db_200511220000.BAK
cardata_tlog_200511220000.TRN
....
cardata_tlog_200511222300... more >>
SELECT statement help needed
Posted by Petar Popara at 11/25/2005 9:09:18 AM
I have this case
Table1 (ID, DoSomething, ...)
Table2 (ID, ID_Table1, ...)
I need to select all records from table 2 where ID=Table1.ID (JOIN) and
Table2.DoSomething = 1:
SELECT a.ID FROM Table2 a, Table1 b WHERE a.ID_Table1 = b.ID AND
b.DoSomething = 1
The problem is that Table2.ID... more >>
need help with crosstab query
Posted by William at 11/25/2005 7:32:01 AM
hey all,
i need some help with a crosstab query. been doing this for 3 days but
no luck
i have a table with the following statusnumber, systemnumber
here is the code i have written
ALTER PROCEDURE dbo.Qrytest4
(@startdate datetime,
@enddate datetime)
AS SELECT Distinct (statusnumber), ... more >>
T-SQL Debugger Proglem.
Posted by vindaloo1 NO[at]SPAM netzero.com at 11/25/2005 7:27:20 AM
I'm trying to use the T-SQL debugger, but I'm getting this message: "SP
debugging may not work properly if you log on as 'Local System
account."
I'm using SQL Server 2000 and Windows XP Home Edition. Even though I
get this message the debugger will run but I can't step through the
stored pro... more >>
copy DTS from a user to another
Posted by Tarek at 11/25/2005 7:20:03 AM
Hi,
I have some local packages that are owned by the old sqlserver dba.I'm not
able to see them, nor to save them with my user (i have granted the system
administrator role).
I want to see these packages and move them to a new user.
How can I do this?
Thanks in advance,
... more >>
SQL Express 2005
Posted by Rick at 11/25/2005 6:41:10 AM
Is it possible to use SQL Express 2005 for an application in Visual Basic 6.0?
Since, the objective is not to installthe whole SQL Express system in the
end-user machine, what should be installed, for the VB 6 Application?
What system requirement should be for the VB 6 user?
Should I instal... more >>
DTS: Transform Data Task with ActiveX
Posted by Spike at 11/25/2005 6:41:02 AM
I trying to write out comment records in 40 byte chunks from a much longer
field(see below) but I can't find any way of writing out the records inside
the loop. The code below works (and the loop is being executed) but nothing
turns up in the output. Does anyone have any thoughts?
'******... more >>
Select statement Help
Posted by kalikoi NO[at]SPAM gmail.com at 11/25/2005 5:17:09 AM
I had a table with 6 columns as below
col1 is the empid
col5 is the status(which will be changed basing on col2..)
so if i give col5 value as a input then i should get the col1,col2.col5
as the output in the select statement
to be more clear
se043 has 4 col5 values with 4 different ... more >>
Import large xml document into sql server 2005
Posted by Vincent Brunie at 11/25/2005 4:51:11 AM
Hi,
I am trying to import a large xml document into sql server 2005 from a c#
client.
On the server side, the database has the following structure:
urn varchar[80] : some identifier
xmlCol xml : the xml data
The following code works well for small xml documents, but I get an
Ou... more >>
More Efficient way to Concat Rows
Posted by hals_left at 11/25/2005 3:41:40 AM
Hi I have this problem with a query to process data concatenating
Units/Modules.
I have one View called Certificates thats lists Course IDs, Candidate
Names and Units. As each Certificate shows multiple Units achieved by
the Candidate I need to transform this data and combine the Units into
a... more >>
Trasform columns to rows
Posted by Nicola at 11/25/2005 3:22:06 AM
Hy
i have this table with one row:
| col1 | col2 | col3 | col4 | col 5 |
---------------------------------------
| txt1 | txt2 | txt3 | txt4 | txt5 |
i must have a table with one row for each column:
| col |
-------
txt1
txt2
txt3
txt4
txt5
Is there any way to do it with a sq... more >>
How to determine default values of a field during runtime
Posted by pol_c NO[at]SPAM tiscali.co.uk at 11/25/2005 2:43:03 AM
Hi, i am using the function below (visual basic 6) to determine several
properties of
each field in a recordset (SQL server) and all is working well. My
problem is that I
dont know how to find the default value of a field from the table. Does
anyone have
any code suggestions that would get... more >>
get fields for Process Info
Posted by Xavier at 11/25/2005 1:43:06 AM
hello,
how can i get in the the information displayed under Process info for Access
I want to get the fields: for (select ???????.....)
Database
Application
Host
ProcessId
User
Status
have
thanks
... more >>
JAVA Total
Posted by 4vinoth NO[at]SPAM gmail.com at 11/25/2005 12:58:18 AM
URL
http://groups.google.com/group/Sun-JAVA-J2EE-EJB-JSP-Applet-Servlet-JDBC-AWT-Swing-JMF
Email
Sun-JAVA-J2EE-EJB-JSP-Applet-Servlet-JDBC-AWT-Swing-JMF@googlegroups.com
... more >>
Cancel Trigger
Posted by Serkan Ahtagil at 11/25/2005 12:08:11 AM
i have a trigger on a table it is working good, but sometimes i need to copy
a large amount of data to that table and i want to disable trigger only for
that transaction. Ýs there any easy way to do this?
... more >>
Re-raising error
Posted by Tumurbaatar S. at 11/25/2005 12:00:00 AM
In a stored procedure I usually check @@ERROR after every
INSERT/UPDATE/DELETE. If any error, then I exit SP with this error
code. A client application does not receive much information
with this code, so it displays a message like "Cannot insert/update record.
Error : NNN".
Is there a way to ... more >>
Update only x records but also depending on a given order.
Posted by Harry Leboeuf at 11/25/2005 12:00:00 AM
We are looking for a way to update (ex) the 5 first rows of a table
depending some selections and a order by clause.
ex (of a non working query)
set rowcount = @arowcount
update t1 set c1 = @something
from t1
where c2 = @sm2
order by c3
anybody has an idea on how to to t... more >>
OLE DB provider name
Posted by Danila Vershinin at 11/25/2005 12:00:00 AM
Hi,
I am trying to get a list of most possible provider names (OLE DB) for the
following database types: (for instance, Access - "Microsoft.Jet.OLEDB.4.0")
DB/2
Ingress
Informix
MySQL
Oracle
Postgres
SQL Server
Sybase
Virtuoso
Can anyone help?
Thanks in advance.
... more >>
Searching records with 'like'
Posted by Pavils Jurjans at 11/25/2005 12:00:00 AM
Hello,
I have this table with ID field and text field. For certain purposes, I need
to save this text field with case-sensitive collation. However, in some
cases I need to look up matches, ignoring the case, using like operator. How
can I override the default collation in this on-the-fly qu... more >>
|