Thursday, March 29, 2012
credentials and permissions for the account that runs reportServer
I'm having a tough time finding what kind of permissions are needed for the
account that runs the Report Server windows Service.
I have my Report Server on a Win2K workstation with IIS and SQL Server on a
different computer (win2k Server and SQL Server 2000 with Sp3a).
We were able to make the subscriptions (emails and file sharing) with the
user being in the domain admin group. Now we are trying to give a little
less permissions to that account, but all the subscriptions are now showing
errors (in the subscription page only, log files are all fine).
The user is a local administrator and is part of the system operator, domain
operator, domain user and user groups on the network.
Does that user need to be a domain administrator? If we have too I don't
really mind but it would be safer to have it with less powerfull rights.
Thanks in advance for your help!I have some more informations so maybe it will help you help me!
The jobs are being created in SQL server. I can see them in SQL Server
Agent. They are even marked as success.
The problem is that I don't receive the email or the file is not created in
the folder as expected. Also the subscription is not being updated in
reports manager. It is still showing as a new subscription as if it was not
executed.
Tuesday, March 27, 2012
Creation date for tables
This is my first time posting in this forum. I am very green in DB2 admin so I would really appreciate your help.
The company had a data warehouse on DB2 7.1 on a sun solaries 8
I want to know how to retreive creation date from any table
ThanksDid you mean to post this in the SQL forum?
Regards,
hmscott|||Right church, wrong pew...
no matter...do this against your database...it should show you the definition of your tables and columns
SELECT * FROM SYSIBM.SYSCOLUMNS WHERE TBCREATOR = 'your owner id'
And try here...
http://www.dbforums.com/f8/
Sunday, March 25, 2012
Creating Total to-date query...
I am trying to create a query where
the data is for a time period but there is
one column that would show a Total-to-date.
I've tried google and searching this forum
but everyone talks about year-to-date or
period-to-date but I don't want that. I would
like to do :
[from whenever data started being entered]-to-date
I know I can hack this by doing an aggregate like
so:
WITH MEMBER [Timesheet].[Date].[TimeChargedTotal] AS
'Aggregate ( { [Timesheet].[Date].[Year].&[1900].&[1].&[1]:[Timesheet].[Date].[Year].&[2006].&[9].&[15] } )'
Here I am betting on the fact that there is no data before 1-1-1900
which is a safe bet, but I'd prefer to do it the 'right' way if there is one.
Thanks.
If you're using AS 2005, then you can try the shorthand:
{ NULL : [Timesheet].[Date].[Year].&[2006].&[9].&[15] }
|||Something like [Time].[Date].FirstChild:[Time].[Date].Lastchild might help. Be aware of performance issues with a large dimension.
Regards
Thomas Ivarsson
|||Thanks guys.
Both answers work.
Is there any performance difference between
using NULL or [Time].[Date].FirstChild as the
beginning of the range?
I am not familiar enough with adventureworks
to give a proper example.
However I will attempt to explain my scenario.
We have a timesheet system where time spent
on various projects/tasks is collected and then
billed to a client.
A report needs to be created that shows the
previous weeks time (a particualr 1 week period with
a start and end date) spent on a particular project/task
by employee X and the total time spent so far on that
project/task by emplyee X up until the end of that period.
This means that year-to-date (or period-to-date) scenario
does not work because we want ALL time up until
the end of the selected period and there is no guarantee
that a project will last a week, month, year, etc...
Hope that somewhat clarifies the usage scenario.
|||Okay this is not working the way I anticipated.
I am clearly not understanding MDX and the book
I am refering to:
'SQL Server 2005 Analysis Services 2005 with MDX'
is of no help.
Here is what I am trying to accomplish conceptually:
WITH MEMBER [Measures].[TimeChargedToDate] AS
'AGGREGATE ( {NULL:@.ToTimesheetDate} )'
SELECT NON EMPTY
{
[Measures].[Time Charged],
[Measures].[TimeChargedToDate]
} ON COLUMNS,
NON EMPTY
{
([Project].[Project Number].[Project Number].ALLMEMBERS
* [Staff Member].[Staff Member Name].[Staff Member Name].ALLMEMBERS )
}
ON ROWS
FROM
(
SELECT ( STRTOSET(@.ProjectProjectNumber, CONSTRAINED) ) ON COLUMNS
FROM
(
SELECT ( STRTOMEMBER(@.FromTimesheetDate, CONSTRAINED)
: STRTOMEMBER(@.ToTimesheetDate, CONSTRAINED) ) ON COLUMNS
FROM [Timesheet_Cube]
)
)
So the moral of the story here is that I want to get
a list of all the projects, then all the users that have
charged time to each project. Then I want the total
hours for the time range specified AS WELL AS the
total time charge up until the cutoff date (@.ToTimesheetDate).
Now as I have just learned you cannot have aggregates
in your Measures, so can some kind soul please
point me to a source where I can ejumicate myself on
this MDX magic? It seems that its much more difficult
to operate with ranges of time in MDX than I though it should be.
|||If you are trying to do something like I
described above, here is how to do it:
WITH MEMBER [Measures].[TimeChargedToDate] AS
'SUM({NULL:[Timesheet].[Date].&[2006].&[9].&[15]},[Time Charged])'
SELECT NON EMPTY
{
[Measures].[Time Charged],
[Measures].[TimeChargedToDate]
} ON COLUMNS,
NON EMPTY
{
([Project].[Project Number].&[PA01203] * [Staff Member].[Staff Member Name].[Staff Member Name].ALLMEMBERS )
} ON ROWS
FROM
(
SELECT
{[Timesheet].[Date].[Year].&[2006].&[9].&[2] : [Timesheet].[Date].[Year].&[2006].&[9].&[15]} ON COLUMNS
FROM
(
SELECT ( [Project].[Project Number].&[PA01203] ) ON COLUMNS
FROM [Timesheet_Cube]
)
)
described above, here is how to do it:
WITH MEMBER [Measures].[TimeChargedToDate] AS
'SUM({NULL:[Timesheet].[Date].&[2006].&[9].&[15]},[Time Charged])'
SELECT NON EMPTY
{
[Measures].[Time Charged],
[Measures].[TimeChargedToDate]
} ON COLUMNS,
NON EMPTY
{
(
[Project].[Project Number].&[PA01203] *
[Staff Member].[Staff Member Name].[Staff Member Name].ALLMEMBERS
)
} ON ROWS
FROM
(
SELECT
{[Timesheet].[Date].[Year].&[2006].&[9].&[2] : [Timesheet].[Date].[Year].&[2006].&[9].&[15]}
ON COLUMNS
FROM
(
SELECT ( [Project].[Project Number].&[PA01203] ) ON COLUMNS
FROM [Timesheet_Cube]
)
)
Creating Time Dimension for seconds
I'd like to create a Time Dimension for "Every 15 seconds"
I've already got a DIM_Time table that includes actual event times (down to milliseconds)
Do I just need to create fields on that data for the 0:15 block that the particular event falls in, and create records for every 0:15 even if there isn't a related row in the measures table?
So that...
Measures
ID TimeId Measure
1 1 100
2 2 200
DIM_Time
TimeId Time
1 0:01.1234
2 0:31.2345
3 0:15
4 0:30
5 0:45
6 1:00
7 1:15
etc...
Hi Greg,
You're on the right track. The reason you would put the 15 second block even if there isn't an actual time for that is later on down the road there may be a fact for that and you would simply add the fact without have to also add the dimension member. You also may want to see for some reason the times that don't have data.
Depending on the requirements, I might break the Min and Seconds out in seperate fields. Like
TimeID Hour Min Sec Actual Time
1 0 0 0 0:10:00
2 0 0 15
3 0 0 45
4 0 1 0
Depending if the facts needs to roll up to a Min. and Hour.
Hope this helps,
David Botzenhart
|||Thanks! I appreciate your clarifications on the table structureThursday, March 22, 2012
Creating Test Database
From time to time, as structural modifications are made to the live
database, I'd like to be able to delete the test database and replace it
with a new copy of the live database. Is there a simple way to do this with
a script or other? Thanks!I'd go for backup and restore. When you do the restore, specify a different database name and use
the MOVE option of the RESTORE command to specify new database file names.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Neil" <nospam@.nospam.netwrote in message news:EAb_i.20588$Pv2.7236@.newssvr23.news.prodigy.n et...
Quote:
Originally Posted by
>I need to create a test database on the live server for performance testing. From time to time, as
>structural modifications are made to the live database, I'd like to be able to delete the test
>database and replace it with a new copy of the live database. Is there a simple way to do this with
>a script or other? Thanks!
>
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.comwr ote in
message news:F4D3C4C1-35C2-4CFE-81C0-A7AF434911AA@.microsoft.com...
Quote:
Originally Posted by
I'd go for backup and restore. When you do the restore, specify a
different database name and use the MOVE option of the RESTORE command to
specify new database file names.
>
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
>
>
"Neil" <nospam@.nospam.netwrote in message
news:EAb_i.20588$Pv2.7236@.newssvr23.news.prodigy.n et...
Quote:
Originally Posted by
>>I need to create a test database on the live server for performance
>>testing. From time to time, as structural modifications are made to the
>>live database, I'd like to be able to delete the test database and replace
>>it with a new copy of the live database. Is there a simple way to do this
>>with a script or other? Thanks!
>>
>|||Neil (nospam@.nospam.net) writes:
Quote:
Originally Posted by
And if there's an existing db with that name, it will overwrite it
entirely?
Yes. I always use the REPLACE option together the MOVE as suggested by
Tibor.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Thanks to both of you!
"Erland Sommarskog" <esquel@.sommarskog.sewrote in message
news:Xns99E7EE6584750Yazorman@.127.0.0.1...
Quote:
Originally Posted by
Neil (nospam@.nospam.net) writes:
Quote:
Originally Posted by
>And if there's an existing db with that name, it will overwrite it
>entirely?
>
Yes. I always use the REPLACE option together the MOVE as suggested by
Tibor.
>
>
>
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
>
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
creating temporary table with SELECT INTO
Dose any body know why a temporary table gets deleted after querying it the
first time (using SELECT INTO)?
When I run the code bellow I'm getting an error message when open the temp
table for the second time.
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E37)
Invalid object name '#testtable'.
-----------------------
-----
cnn.Execute("SELECT category, product INTO #testtable FROM properties")
'--creating temporary TestTable and populate it with values from another
table
SET rst_testt = cnn.Execute("SELECT * from #testtable") '-- opening
the temporary TestTable
SET rst_testt2 = cnn.Execute("SELECT * from #testtable") '-- ERROR
opening the temporary TestTable for the second time (that where the error
occurred)
rst_testt2.Close '-- closing table connection
SET rst_testt2 = nothing
rst_testt.Close '-- closing table connection
SET rst_testt = nothing
cnn.Execute("DROP TABLE #testtable") '-- dropping the temporary
TestTable
'-----------------------
-----
But when I create the temp table first and then INSERT INTO that table some
values then it is working fine.
'-----------------------
-----
cnn.Execute("CREATE TABLE #testtable (category VARCHAR(3), product
VARCHAR(3))")
cnn.Execute("INSERT INTO #testtable VALUES('5','4')")
SET rst_testt = cnn.Execute("SELECT * from #testtable") '-- opening
the temporary TestTable
SET rst_testt2 = cnn.Execute("SELECT * from #testtable") '-- opening
the temporary TestTable for the second time
rst_testt2.Close '-- closing table connection
SET rst_testt2 = nothing
rst_testt.Close '-- closing table connection
SET rst_testt = nothing
cnn.Execute("DROP TABLE #testtable") '-- dropping the temporary
TestTable
'-----------------------
-----
Does any body know why the first code (SELECT INTO) is not working where the
second code it working?
regards,
goznal[posted and mailed, please reply in news]
gonzal (k2net@.dodo.com.au) writes:
> Dose any body know why a temporary table gets deleted after querying it
> the first time (using SELECT INTO)?
> When I run the code bellow I'm getting an error message when open the temp
> table for the second time.
> Error Type:
> Microsoft OLE DB Provider for SQL Server (0x80040E37)
> Invalid object name '#testtable'.
> -----------------------
> cnn.Execute("SELECT category, product INTO #testtable FROM properties")
> '--creating temporary TestTable and populate it with values from another
> table
> SET rst_testt = cnn.Execute("SELECT * from #testtable")
> '-- opening the temporary TestTable
> SET rst_testt2 = cnn.Execute("SELECT * from #testtable")
> '-- ERROR opening the temporary TestTable for the second time (that
> where the error occurred)
What's happening is that ADO is opening a second connection behind your
back. This has really not anything to do with how you created the table.
The reason that ADO opens an extra connection, is because there are
rows waiting to be fetched on the first connection, so ADO cannot
submit a query on that connection. I cannot really say why it only happened
in one place, but it may be related to the type of cursor you picked,
and the fact that in the second example, there is only one row in
the table.
Use a static client-side cursor. I would expect this to resovle the
problem.
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks Erland
You were right.
ADO is opening an extra connection thats why it is not working and the
second example is working because only one record was inserted. If I
change to second code to:
cnn.Execute("INSERT INTO #testtable VALUES('5','4')")
cnn.Execute("INSERT INTO #testtable VALUES('2','3')") -- inserting
second row
Then it is not working, same as the first example.
As you have suggested in your previous email to use a static client-side
cursor, I have change to code to:
set rst_tre = Server.CreateObject("ADODB.RecordSet"
rst_tre.CursorLocation = 1 '-- adUseClient
rst_tre.CursorType = 3 '-- adOpenStatic
rst_tre.LockType = 2 -- adLockOptimistic
sql_tre = "SELECT category, product INTO #testtable FROM products"
rst_tre.Open sql_tre,cnn
SET rst_tre = nothing
But it is still not working.
Any suggestion why?
I head a look at some logs from SQL:
SQL:BatchCompleted; SELECT category, product INTO #testtable FROM
products
SQL:BatchCompleted; SELECT * from #testtable
Audit Login -- network protocol:
SQL:BatchCompleted SELECT * from #testtable
Audit Logout
Any suggestions why ADO opens another connection after opening the
#testtable for the first time?
Another think I have noticed is that when I open the #testtable only
once it is working fine.
Thanks,
Gonzal
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||gonzal (nospam@.abc.abc) writes:
>
> set rst_tre = Server.CreateObject("ADODB.RecordSet"
> rst_tre.CursorLocation = 1 '-- adUseClient
> rst_tre.CursorType = 3 '-- adOpenStatic
> rst_tre.LockType = 2 -- adLockOptimistic
> sql_tre = "SELECT category, product INTO #testtable FROM products"
> rst_tre.Open sql_tre,cnn
> SET rst_tre = nothing
>
> But it is still not working.
> Any suggestion why?
I have to admit that I'm no ADO guru, so I cannot really say what is
happening. However I did a quick test, and this did not give me a
second connection:
Dim cnn As ADODB.Connection
Dim cnnErr As ADODB.Error
Set cnn = New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
On Error GoTo errHandle
Dim oCommand As ADODB.Command
cnn.ConnectionString = "Provider=" & Trim$(Provider.Text) & ";" & _
"Data Source=" & Trim$(DataSource.Text) & ";" & _
"User Id=" & Trim$(User.Text) & ";" & _
"Password=" & Trim$(Password.Text) & ";" & _
"Initial Catalog=" & Trim$(Database.Text) & ";" & _
"Use Procedure for Prepare=0"
cnn.ConnectionTimeout = 5
cnn.CursorLocation = adUseClient
cnn.Open
Set oCommand = CreateObject("ADODB.Command")
Set oCommand.ActiveConnection = cnn
oCommand.CommandType = adCmdText
oCommand.CommandText = "select name into #temp from sysobjects"
oCommand.Execute
rs.Open "SELECT * FROM #temp", cnn
rs2.Open "SELECT * FROM #temp", cnn
--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Try to make the temporary table a global variable by using two #
characters like: ##testtable. This probably will solve your problem.
Greetings Sjaak
Tuesday, March 20, 2012
Creating stored procedures in sql server
I just installed sql server 2005 on my machine. I've been using Access for some time and have created my stored procedures easily in it. However, this sql server 2005 is so complicated. In Access, all I had to do was "Create a New Query", write my sql statement, name and save it.
However, I am having so much trouble with this sql server. For example, when I create a stored procedure in sql server, it has a .sql extension. I am assuming the stored procedure is a file. However, after saving it, I expand my database, expand programmability, and expand stored procedures, yet my new stored procedure is not there. It's placed in a file called projects. I need to access this stored procedure from code, but in visual studio, I get an error message, "Cannot find stored procedure sp_Roster".
Here is the code I used to access my stored procedure from vb.net. I thought it would work but it didnt
Dim comm As New SqlCommand
Dim strsql As String
Dim strconn As String
strsql = "sp_Roster"
strconn = "server=Home; user=sa; pwd=juwar74; database=Book;"
With comm
.Connection = New SqlConnection(strconn)
.CommandText = strsql
.CommandType = CommandType.StoredProcedure
With .Parameters.Add("TeacherID", SqlDbType.Char)
.Value = "DawsMark@.aol.com"
End With
With .Parameters.Add("ClassID", SqlDbType.Int)
.Value = CInt(classid)
End With
With .Parameters.Add("sID", SqlDbType.Int)
.Value = ssID
End With
With .Parameters.Add("sLastName", SqlDbType.Char)
.Value = lastname
End With
With .Parameters.Add("sFirstName", SqlDbType.Char)
.Value = firstname
End With
With .Parameters.Add("sMiddleName", SqlDbType.Char)
.Value = middlename
End With
With .Parameters.Add("Student", SqlDbType.Char)
.Value = fullname
End With
With .Parameters.Add("Password", SqlDbType.Char)
.Value = password
End With
.Connection.Open()
.ExecuteNonQuery()
With comm.Connection
If .State = ConnectionState.Open Then
.Close()
End If
End With
End With
Here is my procedure that I created and that was saved as sp_Roster.sql in sql server
CREATE PROCEDURE sp_Roster
AS
BEGIN
SET NOCOUNT ON;
-- Insert statements for procedure here
INSERT INTO Roster (TeacherID, ClassID, sID, sLastName, sFirstName, sMiddleName, Student, Password) VALUES (@.TeacherID, @.ClassID, @.sID, @.sLastName, @.sFirstName, @.sMiddleName, @.Student, @.Password)
END
GO
Why isn't ado.net finding it in sql server. Is the sqlstr correct?
In order to save a stored procedure to the DB in SQL 2005 you need to execute this code instead of saving the text as a file. Just click the "Execute" button and you should be ok. Another thing however, is that you have not declared your variables. You will not be able to execute/save your stored procedure without this.
CREATEPROCEDURE sp_Roster@.TeacherIDint,
@.ClassIDint,
@.sIDint,@.sLastNamenvarchar(100),
@.sFirstNamenvarchar(100),@.sMiddleNamenvarchar(50),
@.Studentnvarchar(100),@.Passwordnvarchar(100)
AS
BEGIN
SETNOCOUNTON;
-- Insert statements for procedure here
INSERTINTO Roster(TeacherID, ClassID,sID, sLastName, sFirstName, sMiddleName, Student,Password)VALUES(@.TeacherID, @.ClassID, @.sID, @.sLastName, @.sFirstName, @.sMiddleName, @.Student, @.Password)
END
GO
|||Unfortunately, Sql Server doesn't work the same as Access in this way. Wehn you save a query in Sql Server, you are saving the query, but no the query to the database. The script has to be run to actually create your stored procedure. This can be done by pressing F5. However, your query itself needs some work as you have no input parameters to your stored procedure.
sqlMonday, March 19, 2012
Creating SQL Triggers
I've done these in the past but it's been a while.
I'd like to create a trigger on a SQL table to track any time a record
in this tables gets updated with a zero value in one of the table
columns.
Client is having an issue where an estimated cost field is getting set
to zero by a certain process and I need a tool to track down the
culprit.
I'd like to trap for this column being set to zero on any update or
insert into this table and then dump this audit trail (user ID, spid,
time, date, etc..) out to a manually created sql table.
Any advice or articles that could help would be much appreciated.
Thanks,
JonCREATE TRIGGER NoZerosPlease ON [YourTable]
FOR UPDATE
AS
BEGIN
INSERT INTO [AuditTable]
SELECT SYSTEM_USER, @.@.SPID, APP_NAME(),
ISNULL(OBJECT_NAME(@.@.PROCID),'Not an sp'),
GETDATE(), d.[YourColumn] AS "PreviousValue"
FROM inserted i INNER JOIN deleted d on i.[PKColumn] = d.[PKColumn]
--more on conditions if you have a composite primary key
WHERE i.[YourColumn] = 0
END
You'll need to create the [AuditTable] table.
--
"JMo" wrote:
> Helllo,
> I've done these in the past but it's been a while.
> I'd like to create a trigger on a SQL table to track any time a record
> in this tables gets updated with a zero value in one of the table
> columns.
> Client is having an issue where an estimated cost field is getting set
> to zero by a certain process and I need a tool to track down the
> culprit.
> I'd like to trap for this column being set to zero on any update or
> insert into this table and then dump this audit trail (user ID, spid,
> time, date, etc..) out to a manually created sql table.
> Any advice or articles that could help would be much appreciated.
> Thanks,
> Jon
>|||Thank You Mark!!
Okay, I plan to create a table with a counter as a primary key and then
create a table with string fields to catch user, spid, and app name and
a date field the getdate function.
Am I on the right track?
Thanks again,
Jon
Mark Williams wrote:
> CREATE TRIGGER NoZerosPlease ON [YourTable]
> FOR UPDATE
> AS
> BEGIN
> INSERT INTO [AuditTable]
> SELECT SYSTEM_USER, @.@.SPID, APP_NAME(),
> ISNULL(OBJECT_NAME(@.@.PROCID),'Not an sp'),
> GETDATE(), d.[YourColumn] AS "PreviousValue"
> FROM inserted i INNER JOIN deleted d on i.[PKColumn] = d.[PKColumn]
> --more on conditions if you have a composite primary key
> WHERE i.[YourColumn] = 0
> END
> You'll need to create the [AuditTable] table.
> --
> "JMo" wrote:
>
Sunday, March 11, 2012
Creating small index takes LONG time!
Manager all default settings, to a table with about 30 columns and about 15K
rows of data. The index is on a smalldatetime column. For some reason, when
I
try to add this index, it takes FOREVER (let it go at least 6 hours, still
not completed). Killed process (which had very high processor count),
restarted SS, tried again, no go. No sign of any locks (in fact, no one even
connected to this database). Plenty of disk space.
Any ideas why this might occur? There are several other indexes on the
table, including primary key id column and other indexes referencing the
column I am trying to index as secondary, tertiary column, but never as
primary column. This is a large database with many tables (100+), lots of
data (4GB or so). But, this seems unusual to me...
I can access the table and the data in it from another instance of EM while
I am trying to create this index.
Any ideas?
Thanks,
ChrisEM is notorious for generating inefficient code. It's far better to script
it by hand because:
1) a skilled human will write better code
2) the script can be used elsewhere and be checked into source code control
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"querylous" <querylous@.discussions.microsoft.com> wrote in message
news:6B6FEF4E-9311-41B6-9E59-457B66090FE2@.microsoft.com...
Hi- I am trying to add a simple, non clustered index, using Enterprise
Manager all default settings, to a table with about 30 columns and about 15K
rows of data. The index is on a smalldatetime column. For some reason, when
I
try to add this index, it takes FOREVER (let it go at least 6 hours, still
not completed). Killed process (which had very high processor count),
restarted SS, tried again, no go. No sign of any locks (in fact, no one even
connected to this database). Plenty of disk space.
Any ideas why this might occur? There are several other indexes on the
table, including primary key id column and other indexes referencing the
column I am trying to index as secondary, tertiary column, but never as
primary column. This is a large database with many tables (100+), lots of
data (4GB or so). But, this seems unusual to me...
I can access the table and the data in it from another instance of EM while
I am trying to create this index.
Any ideas?
Thanks,
Chris|||Chris,
Either it is not building the index, or something is seriously wrong.
An index like you describe should be built in seconds.
When I just created an index using Enterprise Manager (within Design
Table) it did not start the process until I closed the Design Table
window, when it prompted me with the question asking if I wanted to
save changes. Did you reach that point?
Roy
On Mon, 27 Feb 2006 17:09:27 -0800, querylous
<querylous@.discussions.microsoft.com> wrote:
>Hi- I am trying to add a simple, non clustered index, using Enterprise
>Manager all default settings, to a table with about 30 columns and about 15
K
>rows of data. The index is on a smalldatetime column. For some reason, when
I
>try to add this index, it takes FOREVER (let it go at least 6 hours, still
>not completed). Killed process (which had very high processor count),
>restarted SS, tried again, no go. No sign of any locks (in fact, no one eve
n
>connected to this database). Plenty of disk space.
>Any ideas why this might occur? There are several other indexes on the
>table, including primary key id column and other indexes referencing the
>column I am trying to index as secondary, tertiary column, but never as
>primary column. This is a large database with many tables (100+), lots of
>data (4GB or so). But, this seems unusual to me...
>I can access the table and the data in it from another instance of EM while
>I am trying to create this index.
>Any ideas?
>Thanks,
>Chris|||Hmmm... looking at the process info, I can see that the query generated by
Enterprise Manager is
CREATE
INDEX [dateCancelled] ON [dbo].[events] ([dateCancelled])
I can't imagine a much more efficient means of creating an index than that?
Thanks,
Chris
"Tom Moreau" wrote:
> EM is notorious for generating inefficient code. It's far better to scrip
t
> it by hand because:
> 1) a skilled human will write better code
> 2) the script can be used elsewhere and be checked into source code contro
l
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> ..
> "querylous" <querylous@.discussions.microsoft.com> wrote in message
> news:6B6FEF4E-9311-41B6-9E59-457B66090FE2@.microsoft.com...
> Hi- I am trying to add a simple, non clustered index, using Enterprise
> Manager all default settings, to a table with about 30 columns and about 1
5K
> rows of data. The index is on a smalldatetime column. For some reason, whe
n
> I
> try to add this index, it takes FOREVER (let it go at least 6 hours, still
> not completed). Killed process (which had very high processor count),
> restarted SS, tried again, no go. No sign of any locks (in fact, no one ev
en
> connected to this database). Plenty of disk space.
> Any ideas why this might occur? There are several other indexes on the
> table, including primary key id column and other indexes referencing the
> column I am trying to index as secondary, tertiary column, but never as
> primary column. This is a large database with many tables (100+), lots of
> data (4GB or so). But, this seems unusual to me...
> I can access the table and the data in it from another instance of EM whil
e
> I am trying to create this index.
> Any ideas?
> Thanks,
> Chris
>|||Are there any processes blocking it?
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"querylous" <querylous@.discussions.microsoft.com> wrote in message
news:0201C2A0-397D-4C4C-9CF6-EC10248E44C7@.microsoft.com...
Hmmm... looking at the process info, I can see that the query generated by
Enterprise Manager is
CREATE
INDEX [dateCancelled] ON [dbo].[events] ([dateCancelled])
I can't imagine a much more efficient means of creating an index than that?
Thanks,
Chris
"Tom Moreau" wrote:
> EM is notorious for generating inefficient code. It's far better to
> script
> it by hand because:
> 1) a skilled human will write better code
> 2) the script can be used elsewhere and be checked into source code
> control
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> ..
> "querylous" <querylous@.discussions.microsoft.com> wrote in message
> news:6B6FEF4E-9311-41B6-9E59-457B66090FE2@.microsoft.com...
> Hi- I am trying to add a simple, non clustered index, using Enterprise
> Manager all default settings, to a table with about 30 columns and about
> 15K
> rows of data. The index is on a smalldatetime column. For some reason,
> when
> I
> try to add this index, it takes FOREVER (let it go at least 6 hours, still
> not completed). Killed process (which had very high processor count),
> restarted SS, tried again, no go. No sign of any locks (in fact, no one
> even
> connected to this database). Plenty of disk space.
> Any ideas why this might occur? There are several other indexes on the
> table, including primary key id column and other indexes referencing the
> column I am trying to index as secondary, tertiary column, but never as
> primary column. This is a large database with many tables (100+), lots of
> data (4GB or so). But, this seems unusual to me...
> I can access the table and the data in it from another instance of EM
> while
> I am trying to create this index.
> Any ideas?
> Thanks,
> Chris
>|||Nope, neither blocking nor blocked by...
"Tom Moreau" wrote:
> Are there any processes blocking it?
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> ..
> "querylous" <querylous@.discussions.microsoft.com> wrote in message
> news:0201C2A0-397D-4C4C-9CF6-EC10248E44C7@.microsoft.com...
> Hmmm... looking at the process info, I can see that the query generated by
> Enterprise Manager is
> CREATE
> INDEX [dateCancelled] ON [dbo].[events] ([dateCancelled])
> I can't imagine a much more efficient means of creating an index than that
?
> Thanks,
> Chris
> "Tom Moreau" wrote:
>
>|||I'm actually using the "manage indexes" window; after specifying the index,
I
click ok, and then another window appears which implies that the index is
being built, and this is where the hang occurs. Also, I know the request has
been sent at that point b/c I can see it as a process. Yes, something is
definitely wrong; I am also used to indexes like this being built in
seconds...
"Roy Harvey" wrote:
> Chris,
> Either it is not building the index, or something is seriously wrong.
> An index like you describe should be built in seconds.
> When I just created an index using Enterprise Manager (within Design
> Table) it did not start the process until I closed the Design Table
> window, when it prompted me with the question asking if I wanted to
> save changes. Did you reach that point?
> Roy
>
> On Mon, 27 Feb 2006 17:09:27 -0800, querylous
> <querylous@.discussions.microsoft.com> wrote:
>
>|||On Mon, 27 Feb 2006 17:46:26 -0800, querylous
<querylous@.discussions.microsoft.com> wrote:
>I'm actually using the "manage indexes" window; after specifying the index,
I
>click ok, and then another window appears which implies that the index is
>being built, and this is where the hang occurs. Also, I know the request ha
s
>been sent at that point b/c I can see it as a process. Yes, something is
>definitely wrong; I am also used to indexes like this being built in
>seconds...
So what happens if you run the same CREATE INDEX in Query Analyzer?
Roy Harvey
Beacon Falls, CT|||Could you please give us the SQL edition, version number, hardware, etc.?
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinpub.com
.
"querylous" <querylous@.discussions.microsoft.com> wrote in message
news:90639871-203F-4402-ADC0-D5D583E5BAB0@.microsoft.com...
Nope, neither blocking nor blocked by...
"Tom Moreau" wrote:
> Are there any processes blocking it?
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> ..
> "querylous" <querylous@.discussions.microsoft.com> wrote in message
> news:0201C2A0-397D-4C4C-9CF6-EC10248E44C7@.microsoft.com...
> Hmmm... looking at the process info, I can see that the query generated by
> Enterprise Manager is
> CREATE
> INDEX [dateCancelled] ON [dbo].[events] ([dateCancelled])
> I can't imagine a much more efficient means of creating an index than
> that?
> Thanks,
> Chris
> "Tom Moreau" wrote:
>
>|||Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation Standard Edition on Windows N
T
5.0 (Build 2195: Service Pack 4)
Never had any trouble with it.
"Tom Moreau" wrote:
> Could you please give us the SQL edition, version number, hardware, etc.?
> --
> Tom
> ----
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinpub.com
> ..
> "querylous" <querylous@.discussions.microsoft.com> wrote in message
> news:90639871-203F-4402-ADC0-D5D583E5BAB0@.microsoft.com...
> Nope, neither blocking nor blocked by...
> "Tom Moreau" wrote:
>
>
Wednesday, March 7, 2012
Creating Partions on Developer Edition
Hi,
I was trying to partition my cube built in MSAS 2005 Developer Edition based on time dimension, however I was running into a lot of issues.
I just read an article which states that cube partition is only possible on Enterprise Edition of MSAS 2005 can someone verify if it is true and if thats the case then why do they provide an option to partition the cube in the developer edition.
Thanks
You can create partitions on developer edition of SQL Server 2005/SSAS2005. Build partitions in BI-Developer Studio, process and check the cube in Management Studio after. Under the Cubes-folder, The cube and the measure group for that cube you can see the partitions.
Regards
Thomas Ivarsson
|||Thomas,
I tried doing that, however if I try to create a partition using query binding and specify a select statement with a where clause. The SQL that MSAS 2005 generates when it builds the cube has a bunch of sub-selects and it fails to validate and so I am unble to build the cube with any new partitions
Thanks
|||Developer Edition supports the functionallity of Enterprise Edition but with licensing limitations, so the problem is not related to the edition you are using. (Please see the licensing terms for details.) A more likely culprit is the relational provider you are using as it sounds like the provider does not support sub-selects. See http://msdn2.microsoft.com/en-us/library/ms175608.aspx for a list of supported relational providers.
|||Ok. It works with the Dev Edition so your problem is probably not about the version of SQL Server. It can be as simple as to check if a key is text, integer or any other datatype. IN 2005 you can build SQL statements for partitions in the same way you write a where clause in TSQL.
Run the new profiler that catches all statements from SSAS2005 and see if any strange behavior appears.
Regards
Thomas Ivarsson
|||Hi,
Thanks for the response guys.
Matt I had one quick question if I am able to process a cube using table binding as opposed to query binding to create partitions and the sql generated during processing of the cube does have sub selects and it does build the cube sucessfully I dont think I would have an issue with my provider correct?
Thomas : I am not quite clear about the part where you say " It can be as simple as to check if a key is text, integer or any other datatype" can you please expand on this
|||I do these errors myself. A key is an integer but I write with a ' ' around it(or reverse). I do not think that my query bound partitions do subselects. It is a normal select query, with a where clause added for you, when I have tried it.
Regards
Thomas Ivarsson
|||If you are using one of the supported providers you should not have any problem. If you are not, it may be that some things are supported in sub-selects but other things are not so some queries may succeed while others fail. You should be able to see the queries the server is generating them and then you can check and see if they are supported by the provider.Creating Partions on Developer Edition
Hi,
I was trying to partition my cube built in MSAS 2005 Developer Edition based on time dimension, however I was running into a lot of issues.
I just read an article which states that cube partition is only possible on Enterprise Edition of MSAS 2005 can someone verify if it is true and if thats the case then why do they provide an option to partition the cube in the developer edition.
Thanks
You can create partitions on developer edition of SQL Server 2005/SSAS2005. Build partitions in BI-Developer Studio, process and check the cube in Management Studio after. Under the Cubes-folder, The cube and the measure group for that cube you can see the partitions.
Regards
Thomas Ivarsson
|||Thomas,
I tried doing that, however if I try to create a partition using query binding and specify a select statement with a where clause. The SQL that MSAS 2005 generates when it builds the cube has a bunch of sub-selects and it fails to validate and so I am unble to build the cube with any new partitions
Thanks
|||Developer Edition supports the functionallity of Enterprise Edition but with licensing limitations, so the problem is not related to the edition you are using. (Please see the licensing terms for details.) A more likely culprit is the relational provider you are using as it sounds like the provider does not support sub-selects. See http://msdn2.microsoft.com/en-us/library/ms175608.aspx for a list of supported relational providers.
|||Ok. It works with the Dev Edition so your problem is probably not about the version of SQL Server. It can be as simple as to check if a key is text, integer or any other datatype. IN 2005 you can build SQL statements for partitions in the same way you write a where clause in TSQL.
Run the new profiler that catches all statements from SSAS2005 and see if any strange behavior appears.
Regards
Thomas Ivarsson
|||Hi,
Thanks for the response guys.
Matt I had one quick question if I am able to process a cube using table binding as opposed to query binding to create partitions and the sql generated during processing of the cube does have sub selects and it does build the cube sucessfully I dont think I would have an issue with my provider correct?
Thomas : I am not quite clear about the part where you say " It can be as simple as to check if a key is text, integer or any other datatype" can you please expand on this
|||I do these errors myself. A key is an integer but I write with a ' ' around it(or reverse). I do not think that my query bound partitions do subselects. It is a normal select query, with a where clause added for you, when I have tried it.
Regards
Thomas Ivarsson
|||If you are using one of the supported providers you should not have any problem. If you are not, it may be that some things are supported in sub-selects but other things are not so some queries may succeed while others fail. You should be able to see the queries the server is generating them and then you can check and see if they are supported by the provider.Creating Partions on Developer Edition
Hi,
I was trying to partition my cube built in MSAS 2005 Developer Edition based on time dimension, however I was running into a lot of issues.
I just read an article which states that cube partition is only possible on Enterprise Edition of MSAS 2005 can someone verify if it is true and if thats the case then why do they provide an option to partition the cube in the developer edition.
Thanks
You can create partitions on developer edition of SQL Server 2005/SSAS2005. Build partitions in BI-Developer Studio, process and check the cube in Management Studio after. Under the Cubes-folder, The cube and the measure group for that cube you can see the partitions.
Regards
Thomas Ivarsson
|||Thomas,
I tried doing that, however if I try to create a partition using query binding and specify a select statement with a where clause. The SQL that MSAS 2005 generates when it builds the cube has a bunch of sub-selects and it fails to validate and so I am unble to build the cube with any new partitions
Thanks
|||Developer Edition supports the functionallity of Enterprise Edition but with licensing limitations, so the problem is not related to the edition you are using. (Please see the licensing terms for details.) A more likely culprit is the relational provider you are using as it sounds like the provider does not support sub-selects. See http://msdn2.microsoft.com/en-us/library/ms175608.aspx for a list of supported relational providers.
|||Ok. It works with the Dev Edition so your problem is probably not about the version of SQL Server. It can be as simple as to check if a key is text, integer or any other datatype. IN 2005 you can build SQL statements for partitions in the same way you write a where clause in TSQL.
Run the new profiler that catches all statements from SSAS2005 and see if any strange behavior appears.
Regards
Thomas Ivarsson
|||Hi,
Thanks for the response guys.
Matt I had one quick question if I am able to process a cube using table binding as opposed to query binding to create partitions and the sql generated during processing of the cube does have sub selects and it does build the cube sucessfully I dont think I would have an issue with my provider correct?
Thomas : I am not quite clear about the part where you say " It can be as simple as to check if a key is text, integer or any other datatype" can you please expand on this
|||I do these errors myself. A key is an integer but I write with a ' ' around it(or reverse). I do not think that my query bound partitions do subselects. It is a normal select query, with a where clause added for you, when I have tried it.
Regards
Thomas Ivarsson
|||If you are using one of the supported providers you should not have any problem. If you are not, it may be that some things are supported in sub-selects but other things are not so some queries may succeed while others fail. You should be able to see the queries the server is generating them and then you can check and see if they are supported by the provider.Saturday, February 25, 2012
Creating Multiple Labels
I've not been using Crystal reports long and subsequently don't know much and need help.
The company i work for uses Efacs v7.2 from Exel Systems as it's ERP with Crystal Reports 7 as the report generator/writer.
We generate a works order/schedule that is sent out onto the shop floor to specify what products need to be manufactured.
This basically shows a Part Number (in both text and Barcode) a Part Description and the Quantity required to be manufactured (amongst other bits of product info).
There can be multiple products on each schedule, all different.
I am now in the process of creating a report that will generate a sticky label that can be placed on the finished products box.
So far i have successfully created a report that picks up both Part Numbers (text & BC) and the Part Desc but it only prints one label per product.
EG Schedule may say
(part number: ) BM1-CLIN (Qty: ) 16
(part number: ) CLK-SUS (Qty: ) 8
(part number: ) MLK-SUS (Qty: ) 8
At the moment i only get 3 labels. I need to find a way of multiplying the Quantity of labels required by the Quantity of the Product being manufactured - so in the above example i'd get 32 labels.
Can anyone help? Let me know if more info is required.
Thanks.In your example, would you want
16 of this label (part number: ) BM1-CLIN (Qty: ) 16
8 of this one (part number: ) CLK-SUS (Qty: ) 8
and 8 of this one (part number: ) MLK-SUS (Qty: ) 8
If you could provide a small matix of data to work from ?
also, how do you group this by Part, or ??
Friday, February 17, 2012
creating documentation
Hi:
When I used SQL 2000 (long time ago) I remember that in the Tools menu, it has an option to create a Full Documentation of all the tables, views, etc used in the database. Know I'm doing a project in SQL 2005 and I want to print that information, but I don't know how. Anyone that can help me?
Thanks,
Johajones
There are several ways to do this, based on what you want to do. You can create a database diagram, you can script items out (one of the best ways) or you could run sp_help against the objects. There are other methods of documenting a database, such as in this set of articles:
http://www.informit.com/guides/content.asp?g=sqlserver&seqNum=108
Tuesday, February 14, 2012
Creating Database
A good sample can be downloaded here:
http://download.microsoft.com/download/C/3/8/C3888A3E-52F8-4FE9-8E41-89150AB0302F/CreateDB.zip.exe
Creating database
I have been using microsoft office access to create database and connect to application built. This is the first time trying to create database using the sql server. How do i create a database using this?
Do i use the sql server management to create it?
Is there any step by step tutorials?
How do i connect the database to the web developer?
For creating a database, look in the BOL. There are several option for creating a database. The most easy one would be use the SQL Server Management Studio, right clicking on the database node > New database, after specifying the name and the properties of the database like collation / storage destination etc. the database will be created. Another option would be to use TSQL commands (BOL will have more information about the syntax and parameters for you). Connecting with the Web developer is quite easy, as you can select the database in the server explorer after connecting to the database server.HTH, jens Suessmeyer.
http://www.sqlserver2005.de|||
Hi thanks for the help.
I am trying to built a web database using the visual studio web developer 2005 express. client will be able to access the database in the intranet server. I found out that i can built a database using the web developer itself so what is the different from built it using the sql server?
|||Have you checked out http://www.LearnSqlServer.com? There's a whole section with step-by-step tutorials on creating/managing databases:takkyangel wrote:
I have been using microsoft office access to create database and connect to application built. This is the first time trying to create database using the sql server. How do i create a database using this?
Do i use the sql server management to create it?
Is there any step by step tutorials?
How do i connect the database to the web developer?
Database Creation, Management and Best Practices - http://www.learnsqlserver.com/VideoTutorials/Sql-Server-Videos/93/Database-Creation-Management-and-Best-Practices.aspx?an=MsdnForums