all groups > sql server programming > october 2006 > threads for monday october 30
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
Ownership of newly attached database when using sp_attach_db?
Posted by kenandcorey NO[at]SPAM gmail.com at 10/30/2006 11:13:49 PM
I am confused about database ownership when using sp_attach_db. I want
to have a non-sysadmin user be able to attach and detach a database, as
well as be the owner of the database it attaches.
In SQL Server 2005, I've created a login called "Maint". I have given
this user a Server Role of "dbc... more >>
can't delete user
Posted by rodchar at 10/30/2006 8:54:01 PM
hey all,
i'm trying to delete an entry under Users of a particular database in sql
express but I keep getting a message that says:
Drop failed for User "Username"
What do I need to do to delete this user?
thanks,
rodchar... more >>
does it have to be in Logins
Posted by rodchar at 10/30/2006 8:33:01 PM
hey all,
If i'm creating a user for sql auth in say like a web.config file in vs2005
do i need to create it under security/users of the db in question or do i
need to create it under Logins of sql server?
thanks,
rodchar... more >>
Recursive ordering in select query?
Posted by NaNa at 10/30/2006 8:07:59 PM
Hello,
I have the table contains reporting definition. The definition table
"report Definition" consist of blockID, reportID, Level, Order,
ParentID( FK ReportID) and decoration related fields(bold, hide and
etc).
The block for the report should look like following
BlockID , ReportID, Le... more >>
CRL SqlPipe SqlProcedure Problem
Posted by elliott at 10/30/2006 7:51:16 PM
I am having a problem with the C# CRL Procedure I wrote; when I execute
it doesn't return the row data. Can anyone see/know what my problem
is?
Here is my code:
[Microsoft.SqlServer.Server.SqlProcedure]
public static void CpsISessionUpdate(SqlGuid Guid, SqlInt32 SiteID)
{
... more >>
need help transporting a db
Posted by rodchar at 10/30/2006 7:08:01 PM
hey all,
i just saved off my prodcution database (sql2005) and I'm trying to restore
to my local sqlexpress for testing. It looks like there was a custom login
name created by the name of vbadmin under the security/users node of the
database. But that user doesn't appear in the logins node fo... more >>
Sorting a query
Posted by gsalbertson at 10/30/2006 5:29:47 PM
Is there a way to use a query to sort data according to a list or set of
rules other than alphabetical or numerical. I have a table that contains
answers to a questionnaire. It's just one table, something like this:
CREATE TABLE [dbo].[Evaluation] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,... more >>
Can not open a view in SQL Server 2005...
Posted by GB at 10/30/2006 5:27:39 PM
Hello,
I have recently migrated my databases from SS 2000 to SS2005.
I have a view which returns 64 977 777 rows in SS2000.
When I execute the following query in SS2005:
SELECT COUNT(*) from Myview
it returns same number 64 977 777,
but when I execute SELECT * from Myview
it returns 33 554 43... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Data Audit Log
Posted by TheMaxx at 10/30/2006 5:10:00 PM
I need to trace all changes in my DB tables. (insert, update delete, delete
cascaded records etc...)
I do not want to create paralel tables with history (even though that is
exactly precision that i need)
Is there a way to use Transaction log for this purpose?
... more >>
Help with Outer Join Query Syntax
Posted by Simon Woods at 10/30/2006 4:28:35 PM
Hi
I'm struggling to re-write this SQL, and am wondering if someone could give
any pointers
SELECT DataTable1.Field1,DataTable2.Field1,DataTable3.Field1
FROM (((((DataTable1
LEFT JOIN DataTable2 ON (DataTable2.Key=DataTable1.Key))
LEFT JOIN DataTable3 ON (DataTable3.Key=DataTable1.Key)))
... more >>
DBCC INDEXDEFRAG
Posted by Sajid S. Malik at 10/30/2006 4:04:45 PM
We are currently running SQL Server 2000 on single box for the last 2 years.
There were some performance issues on the database and after analysing I saw
that the database required defragmentation. So I executed DBCC INDEXDEFRAG
on all the tables and things went back to normal in terms of the ... more >>
Storing XML
Posted by Joe at 10/30/2006 3:30:38 PM
What data type is best to store XML? I do not want to use xml data type and
want a quick and small in size. I was looking at converting the xml into a
byte array and storing it as varbinary. Any suggestions?
Thanks
... more >>
Multiple if exist Stored Procedure Problem
Posted by Leon at 10/30/2006 3:20:29 PM
Why the following stored procedure does not work? I can't really see the
error myself, and could
this procedure be wrote more effectively??? any help would be greatly
appreciated!
CREATE PROCEDURE AddChurchAndType
(
@Name varchar(100),
@Address varchar(100),
@City varchar(50),
@... more >>
Request for opinions on the INCLUDE() use in an index
Posted by Gaetan at 10/30/2006 2:42:29 PM
Given this test table which is planned to contain between 50K and 200K rows;
CREATE TABLE Car
(
AccountNo int NOT NULL, -- clustered PK
VIN varchar(32) NOT NULL,
Leased bit NOT NULL
)
I will need to do these queries;
Select Count(*) FROM Car WHE... more >>
why does CAST round
Posted by stevehunter_1 NO[at]SPAM hotmail.com at 10/30/2006 12:44:25 PM
declare @test decimal(18,9)
SET @test = CAST('12.75' AS decimal)
PRINT @test
result = 13.00
Why not 12.75, what am i doing wrong??
... more >>
Find duplicate record query
Posted by ggao NO[at]SPAM och.ca at 10/30/2006 12:21:05 PM
Hi
I have a table (mytable) looks like this
Mytable
IDUSER OPTFIELD VALUE
A00002 MYCODE 21
A00002 HISCODE B
A00015 MYCODE 10
A00015 HISCODE B
A00028 MYCODE 30
A00028 HISCODE A
....
I would like to list all the records for OPTFIELD='HISCODE' with the
... more >>
Newbie, optimization of an update query urgent
Posted by xdude at 10/30/2006 11:59:39 AM
Hi guys, i'm running SQL Server 2000.
Ii'm having trouble with this query (mainquery), it takes a very long time
to finish, about 6 hours, can anyone help me optimized this query (main
query), all the joins are needed, the table Actuals now has about 9 million
records, theres also a table c... more >>
granting select on a table in a schema in a db to another schema in another db
Posted by Menon at 10/30/2006 11:46:12 AM
Consider two databases db1 and db2. In db2, you have schema1 and it has
a table t1. I want to access this table while connected to db2 as a
user whose default schema is schema2. Can anyone explain how I can
grant this permission?
... more >>
software to update/insert into sql databases?
Posted by stevehunter_1 NO[at]SPAM hotmail.com at 10/30/2006 11:43:28 AM
Is there some simple software this has a framework (open source or
easily extensible) for me to build client software that will query
databases and let the user insert rows and update them?
This is to give the clients ability to maintain the database. I
currently use server managent studio an... more >>
help with join - many to many contatinating a field to itself ??
Posted by Jason at 10/30/2006 11:34:36 AM
Not sure what to call this.
Say I have two tables:
header:
Id
Name
detail:
Id
Type
Date
There's gonna be about 10 records for every Id in header and about 200
for every Id in detail.
I'd like to end up with :
hd:
Names Type Date
where Names contains every Name under tha... more >>
where did "CREATE STATISTICS" come from?
Posted by Yofnik at 10/30/2006 10:42:02 AM
Hello All,
I was just using Enterprise Manager to automatically script my database
objects. I noticed that it created this statement:
/****** The index created by the following statement is for internal
use only. ******/
/****** It is not a real index but exists as statistics only. ******/
... more >>
SQL query issue
Posted by Jun at 10/30/2006 10:21:02 AM
I have a report based on the following qurey. It is supposed to return top
100 clients in two years in terms of sales and compare the sales of each
company side by side. If I choose the same starting month and ending month,
everything runs well. But if I choose a different starting month than ... more >>
Alter Table Refresh!!!
Posted by Vai2000 at 10/30/2006 9:45:43 AM
Hi All, I have a SQL2k server and a bunch of apps (.net and native c++)
using tables in it. I recently altered a table and added a column to it.
Bizarre thing is on my Query analyzer if I do sp_help <tablename> I can see
the new column, but my .net and native apps don't see this new column
Any... more >>
Need Help with a Query
Posted by rk2008 NO[at]SPAM gmail.com at 10/30/2006 9:41:42 AM
I have a table with the following rows ( columns LowerLimit,
UpperLimit. 1st row has values 1,10)
LowerLimit UpperLimit
1 10
The result set should return the rows between 1 and 10 inluding them.
It should look somehting like this..
1
2
3
4
5
6
7
8
9
10
... more >>
Auto Incrementing number display on form submit
Posted by Mangler at 10/30/2006 9:30:19 AM
I dont know if this is possible or if someone has a better way to do
this but here it is:
I have a page where the user enters an rma#, lot#, and number of
barcodes they need to print, here is the code for the results page that
shows the barcodes to print:
<%
RMABarCode = Request.Form("idr... more >>
Process blocked by itself?
Posted by nkw at 10/30/2006 9:21:01 AM
I am checking the Locks/Process ID of current activity. However, I found from
time to time some processes are blocked by themselves (e.g. spid 65 (Blocked
by 65)) and released and then blocked by themself agan. Any issue of the
database?... more >>
Microsoft SQL Server Management Studio (non express) and a SqlExpress install
Posted by sloan at 10/30/2006 9:17:27 AM
Ok,
Locally, I have installed a version of SqlExpress (2005).
The "freebie" Management Studio does not allow managing of Jobs (or better
said as it does not support "SQL Server Agent"). (See QUOTES below)
Ok, I'm looking for a legal option to be able to manage jobs on my
SqlExpress.... more >>
determining if a type is user-defined or not
Posted by Dwayne King at 10/30/2006 8:41:02 AM
Hi there,
How can I accurately determine if a row in systypes is for a user-defined
datatype?
I can't seem to see any column that differs from any of the other types, and
I don't see a built-in function (e.g. IS_USER_DEFINED) to check the
attribute.
The only thing I notice is that i... more >>
Convert varchar to int
Posted by Wes at 10/30/2006 8:18:42 AM
Hello,
I have to convert a varchar field to a int field (16,6).
The varchar field looks like 20061030.171623 (it represents a date
obviously).
I have no idea how to do this.
Thanks, Wes
... more >>
what's the best space saving type to store percentage data
Posted by nkw at 10/30/2006 8:04:02 AM
which pecision is 4. that is from 0.1234. smallint sounds the smallest one.
but it need to create a view to convert it (/10000.)... more >>
return reoccuring values
Posted by airwalker at 10/30/2006 7:54:02 AM
hi there, my table has a column named user_id, in that column are various
user id's. What I need is a select statement that will return all the user
id's that occur more than once in the column.
thanks in advance... more >>
UPDATE and SELECT in same transaction problem
Posted by MultiMarine at 10/30/2006 7:40:01 AM
I have a problem, PendingMessages is a view with a few columns wich
includes PulledByService.
This works but i would like to do the update first so i get the correct
value for PulledByService. But when i use the update first it doesn't
return any rows.
BEGIN TRAN
SELECT *
FROM PendingMe... more >>
Guru needed When do reads become a problem
Posted by Sammy at 10/30/2006 7:38:03 AM
Hi I have been using profiler one row has 733126 for duration and the reads
are 1057851715 does this mean, this is the total data sent to the client
computer?
Does this value for the reads look like this could be an issue?
thanks for any advice
Sammy
... more >>
Data encryption in SQL 2005
Posted by shil at 10/30/2006 7:13:36 AM
Hi all,
I would like to develop a VB.NET windows application with SQL 2005 as a
database. My requirement is data must be sent to VB app in an ecrypted
format and the app will decrypt the data. When I deploy the application
to clients machines and when they try to open the databse, they
should... more >>
Need help with patterns of data!
Posted by D. at 10/30/2006 4:35:51 AM
I need to create a stored procedure which is populating one table with
information contained in another table. In the source table the data on
a specific column (Stock column) is in the format I (In) and O (Out) on
separate rows for a specific record. What I need to do is enforce a
rule that che... more >>
Query to check the User privilages
Posted by Shyam at 10/30/2006 12:52:02 AM
Hi,
Is there a way to check for the User privilages for a Database using a
query? I'm sure it's possible thru the Enterprise Mgr, but how to check the
same using a query.
Any hint/advice is aprreciated.
Regards,
Shyam... more >>
problems with this SP
Posted by Jeff at 10/30/2006 12:00:00 AM
hey
My problem is that my select don't return any rows. As you see I have
commented out the "where" clause, because I thought the error was related to
it, but no it wasn't. The SP return no rows.. The table has about 20 rows,
so the output should have been the same...
The DBMS here is th... more >>
same network?
Posted by SOC at 10/30/2006 12:00:00 AM
Hello,
Does a sql server machine which is providing a backend to web site, have to
be on the same network as the web server?
Thanks Soc.
... more >>
Database Maintenance Planner
Posted by news.microsoft.com at 10/30/2006 12:00:00 AM
Hi All,
What is the required user role for database maintenace plannner.
Thanks.
... more >>
|