Showing posts with label creating. Show all posts
Showing posts with label creating. Show all posts

Thursday, March 22, 2012

Delayed Send

Hi

My application sends notifications by creating a once-off subcription, then raising an event in Notification Services. This causes the notification to be issued immediately.

I want to be able to create a notification that is not sent until some time in the future. I'm not sure if I should be looking at ScheduledRules or EventRules.

Has anyone done anything similar?

Thanks

Robert.

Event driven rules produce notifications as events come into the notification application. Scheduled rules create notifications according to the schedule defined in the subscription. Take a look at the ScheduleRecurrence and ScheduleStart properties of the Subscription class.

HTH...

Joe

Friday, March 9, 2012

Defining Variables in Date fields within a Trigger?

Hi All,

I am creating an Insert Trigger with following example of code for you to go off(just an example)

DECLARE @.CREATIONDATE VARCHAR(12)
SET @.CREATIONDATE = (Select Inserted.Creation_Date from Inserted)

Insert into fintest.dbo.glf_chart_acct(fintest.dbo.chart_name, fintest.dbo.accnbri, fintest.dbo.descr1, fintest.dbo.date)
Values ('Name', 'Code', 'Description', {d @.CREATIONDATE})

Inserted.CreationDate is Varchar and the fintest.dbo.date colunm is a datetime field

When checking the Syntax for the trigger it errors saying that - 'Error Syntax near '@.CREATIONDATE'

It works fine if I just insert a static value such as
{d '2002-10-10'}. Am I able to replace the static value with a variable and if so what will my syntax be? How would it look?

Thanks
Anthonyhow about:

Insert into fintest.dbo.glf_chart_acct
(chart_name, accnbri, descr1, date)
select 'Name', 'Code', 'Description', Creation_Date
from Inserted

SQL Server will automatically convert a string to a date and you have the advantage of handeling one or more records at a time!|||DECLARE @.CREATIONDATE VARCHAR(12)
SET @.CREATIONDATE = (Select Inserted.Creation_Date from Inserted)

Insert into fintest.dbo.glf_chart_acct(fintest.dbo.chart_name, fintest.dbo.accnbri, fintest.dbo.descr1, fintest.dbo.date)
Values ('Name', 'Code', 'Description', {d @.CREATIONDATE})

Inserted.CreationDate is Varchar and the fintest.dbo.date colunm is a datetime field

How about instead of the {d @.CREATIONDATE} you either put just @.CREATIONDATE or try a CAST(@.CREATIONDATE as datetime)

Defining Analysis Services Named Calculation

Hi,

I am creating a new Named Caluclation for time dimension in dsv and added in the time dimension cube from the data source view in the time dimension structre.

While processing it is giving the error message that

"Memory error: The operation cannot be completed because the memory quota estimate exceeds the available system memory"

Can you please help me.

Thanks

Dinesh

What does the named calculation look like? And does it process if you take it out?

Cheers

Matt

|||

Show us the named calculation statment...

Works ok without the Named Calculation?!

Regards

|||

Hi

I have used the named calculation "ReportDate + ' ' + Session" in time dimension.

can you let me know how to add this namedcalculation to the cube after creating the named calcualtion in dsv.

Thanks

Dinesh

|||

Hi,

ReportDate and Session are both strings? If not you probably get problems, you will need to cast them as a string/varchar in order for your named calculation to work.

Adding to a dimension, just edit your dimension and drag it onto the attributes list. If it is a new measure, edit your cube and right click, add new measure, select the new named calculation.

Hope that helps

Matt

|||

You already created the NC in the DSV? Correct?

The cube processing generate errors only after your created the NC, correct?

Regards

|||

Hi,

ReportDate and Session are both strings. I added that into atribute list and processed.

It is giving the error message like

"Memory error: The operation cannot be completed because the memory quota estimate (1976MB) exceeds the available system memory (659MB). "

So, what to do for this type of error

Thanks

Dinesh

|||

Hi,

Looks like this is a known bug with SSAS, I haven't seen it before, but it looks like there is a hotfix for it.

http://support.microsoft.com/kb/914595

Hope that helps

Matt

|||

Hi,

Yes after creating the NC only this problem came. before i tested the cube there is no problem.

can you please let me know what is the problem.

Thanks

Dinesh

|||

Check the Matt link and fix the bug, if you will still need some help, tell us!

regards!

Saturday, February 25, 2012

defaulting newly created objects to DBO

Hi, i know that for non-sysadmin role members, non-qualified objects
will be owned by the creating user.
Is it possible to change this so that objects created by users
belonging to database role 'db_owner' default to dbo?
Thanks,
RafetJust have the CREATE statement use dbo as the schema.
create table dbo.test
Randy Dyess
www.Database-Security.Info|||Not really. You could use sp_addalias but it's not
recommended to go this route and sp_addalias is provided for
backwards compatibility only.
Members of db_owner should qualify the objects they are
creating with dbo. It's considered good practice to always
qualify objects with the owner name - when creating or
referencing objects. Qualifying objects improves performance
and readability.
-Sue
On 5 Mar 2004 07:16:48 -0800, rducic@.hotmail.com (Rafet)
wrote:

>Hi, i know that for non-sysadmin role members, non-qualified objects
>will be owned by the creating user.
>Is it possible to change this so that objects created by users
>belonging to database role 'db_owner' default to dbo?
>Thanks,
>Rafet|||I am puzzled about this too. I am about to start using sp_addalias though.
I think Microsoft needs to think this area through a little better. I know
sp_addalias may go away some day, but the current version doesn't handle thi
s well.
In test, we like to give developers logins that link to the dbo user so that
we can have the system enforce all objects getting created by dbo. Then wh
en we create these in production we can be comfortable that the user is the
same and any code that refe
rences the user will always be "dbo" and not "joe_developer".
While it is best practice for developers to always reference user name with
objects, in practice it is harder to enforce without the system to do it for
us. Our company employs consultants regularly and they all seem to have di
fferent habits we end up ha
ving to work on with them.

Friday, February 24, 2012

Default Value?

Hi, I'm creating a dynamic group of values using SELECT and UNION

Example:
(SELECT Description = 'Changed PhoneNumber from ' + @.old_PhoneNumber + ' to ' + @.PhoneNumber
WHERE @.PhoneNumber <> @.old_PhoneNumber UNION ALL

SELECT Description = 'Changed FaxNumber from ' + @.old_FaxNumber + ' to ' + @.FaxNumber
WHERE @.FaxNumber <> @.old_FaxNumber UNION ALL

SELECT Description = 'Changed EmailAddress from ' + @.old_EmailAddress + ' to ' + @.EmailAddress
WHERE @.EmailAddress <> @.old_EmailAddress)

The problem here is that SQL Server thinks "Description" is an int (by default probably) and gives me an error when I try to assign a string to it.

I'm taking that information and using it as a field in a INSERT INTO ... SELECT statement, so I don't think I am able to use a DECLARE statement or if that would even work.

Does anyone know how I can make it so that Description is always a varchar?

Maybe?

SELECT 'Changed PhoneNumber from ' + @.old_PhoneNumber + ' to ' + @.PhoneNumber AS Description

You could also do this:

SELECT CAST('Changed PhoneNumber from ' + @.old_PhoneNumber + ' to ' + @.PhoneNumber AS varchar) AS Description

OR:

SELECT 'Changed PhoneNumber from ' + CAST(@.old_PhoneNumber AS varchar) + ' to ' + cast(@.PhoneNumber AS varchar) AS Description

|||

The third option worked, but I only needed to do it with the Integers. Since there were integers in the string SQL Server tried to convert the entire string into an integer across every SELECT command in the union.

So since I had an integer many SELECTs down it was telling me "can't convert name to integer" even though there was no integer in sight of that particular SELECT statement. Pretty confusing if you ask me.

Friday, February 17, 2012

Default Value

How do you give a Column a default value when creating a DB Table?USE Northwind
GO

CREATE TABLE myTable99(
Col1 int IDENTITY(1,1)
, Col2 char(1) DEFAULT 'Y'
, Col3 datetime DEFAULT GetDate()
, Col4 sysname DEFAULT USER
, Col5 varchar(255)
, CONSTRAINT Col2_Check CHECK (Col2 IN ('Y','N'))
, CONSTRAINT Col1_PK PRIMARY KEY(Col1)
)
GO

INSERT INTO myTable99(Col5) SELECT 'TEST ROW 1'

SELECT * FROM myTable99
GO

DROP TABLE myTable99
GO

default SSIS package location

After creating a complex SSIS package, I am unable to locate it. My guess is
that it is located in a default location. Where is that?
Regards,
Jamie
Well, that was productive! Ahem! Someone was sleeping during the beta.
<snooze - wha? - oh> I'm not sure I was clear on the question. I created an
SSIS package from the export wizard in VS 2005 that is transfering tables
from one database to another. At the end of the script there is a choice to
run immediately and to save the SSIS package. I chose save. I searched
both servers and my local machine. I don't see the package.
Regards,
Jamie
"thejamie" wrote:

> After creating a complex SSIS package, I am unable to locate it. My guess is
> that it is located in a default location. Where is that?
> --
> Regards,
> Jamie
|||The default is SQL Server on the same server as the source connection,
assuming the original defaults weren't accepted and package wasn't run and
deleted.
If you register Integration Services in SSMS and look in the "Stored
Packages\MSDB" path you should see it there.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

default SSIS package location

After creating a complex SSIS package, I am unable to locate it. My guess is
that it is located in a default location. Where is that?
--
Regards,
JamieWell, that was productive! Ahem! Someone was sleeping during the beta.
<snooze - wha? - oh> I'm not sure I was clear on the question. I created an
SSIS package from the export wizard in VS 2005 that is transfering tables
from one database to another. At the end of the script there is a choice to
run immediately and to save the SSIS package. I chose save. I searched
both servers and my local machine. I don't see the package.
--
Regards,
Jamie
"thejamie" wrote:
> After creating a complex SSIS package, I am unable to locate it. My guess is
> that it is located in a default location. Where is that?
> --
> Regards,
> Jamie|||The default is SQL Server on the same server as the source connection,
assuming the original defaults weren't accepted and package wasn't run and
deleted.
If you register Integration Services in SSMS and look in the "Stored
Packages\MSDB" path you should see it there.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

default SSIS package location

After creating a complex SSIS package, I am unable to locate it. My guess i
s
that it is located in a default location. Where is that?
--
Regards,
JamieWell, that was productive! Ahem! Someone was sleeping during the beta.
<snooze - wha? - oh> I'm not sure I was clear on the question. I created a
n
SSIS package from the export wizard in VS 2005 that is transfering tables
from one database to another. At the end of the script there is a choice to
run immediately and to save the SSIS package. I chose save. I searched
both servers and my local machine. I don't see the package.
--
Regards,
Jamie
"thejamie" wrote:

> After creating a complex SSIS package, I am unable to locate it. My guess
is
> that it is located in a default location. Where is that?
> --
> Regards,
> Jamie|||The default is SQL Server on the same server as the source connection,
assuming the original defaults weren't accepted and package wasn't run and
deleted.
If you register Integration Services in SSMS and look in the "Stored
Packages\MSDB" path you should see it there.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

Default SQL 2000 Compatability Level problem

I have a SQL 200 server that creates all new databases in compatability level
65. This is creating problems for an application that requires level 80 to
create and populate. How do I change the default level for any new databases?
Chris Millette
MCP/Network Administrator
Community Bank & Trust
The process that creates the database deletes it if it cannot complete the
entire process. I did find a scipt that changes the model db level and that
resolved the issue.
Chris Millette
MCP/Network Administrator
Community Bank & Trust
"Hari Prasad" wrote:
[vbcol=seagreen]
> Change the compatibility level of Model database to 80; after that what ever
> database you create newly
> the compatibility level will be 80.
> Thanks
> Hari
> "Millette" wrote:

Default SQL 2000 Compatability Level problem

I have a SQL 200 server that creates all new databases in compatability level
65. This is creating problems for an application that requires level 80 to
create and populate. How do I change the default level for any new databases?
--
Chris Millette
MCP/Network Administrator
Community Bank & TrustChange the compatibility level of Model database to 80; after that what ever
database you create newly
the compatibility level will be 80.
Thanks
Hari
"Millette" wrote:
> I have a SQL 200 server that creates all new databases in compatability level
> 65. This is creating problems for an application that requires level 80 to
> create and populate. How do I change the default level for any new databases?
> --
> Chris Millette
> MCP/Network Administrator
> Community Bank & Trust|||The process that creates the database deletes it if it cannot complete the
entire process. I did find a scipt that changes the model db level and that
resolved the issue.
--
Chris Millette
MCP/Network Administrator
Community Bank & Trust
"Hari Prasad" wrote:
> Change the compatibility level of Model database to 80; after that what ever
> database you create newly
> the compatibility level will be 80.
> Thanks
> Hari
> "Millette" wrote:
> > I have a SQL 200 server that creates all new databases in compatability level
> > 65. This is creating problems for an application that requires level 80 to
> > create and populate. How do I change the default level for any new databases?
> > --
> > Chris Millette
> > MCP/Network Administrator
> > Community Bank & Trust

Default SQL 2000 Compatability Level problem

I have a SQL 200 server that creates all new databases in compatability leve
l
65. This is creating problems for an application that requires level 80 to
create and populate. How do I change the default level for any new databases
?
--
Chris Millette
MCP/Network Administrator
Community Bank & TrustChange the compatibility level of Model database to 80; after that what ever
database you create newly
the compatibility level will be 80.
Thanks
Hari
"Millette" wrote:

> I have a SQL 200 server that creates all new databases in compatability le
vel
> 65. This is creating problems for an application that requires level 80 to
> create and populate. How do I change the default level for any new databas
es?
> --
> Chris Millette
> MCP/Network Administrator
> Community Bank & Trust|||The process that creates the database deletes it if it cannot complete the
entire process. I did find a scipt that changes the model db level and that
resolved the issue.
--
Chris Millette
MCP/Network Administrator
Community Bank & Trust
"Hari Prasad" wrote:
[vbcol=seagreen]
> Change the compatibility level of Model database to 80; after that what ev
er
> database you create newly
> the compatibility level will be 80.
> Thanks
> Hari
> "Millette" wrote:
>

Tuesday, February 14, 2012

default settings when creating a database

Hello,
Some users create new databases using the enterprise manager console (right
click in the database section and then selecting new database).
Once created this database has default settings like "Auto shrink" checked
or "Auto close" unchecked (in the option tab).
Is there a way to set these default settings so each time a new database is
created it has the right options?
thanks
Yes, set the correct options on the Model database. That database is the
baseline from which all other databases on a server are created.
<grille11@.yahoo.com> wrote in message
news:cjju9f$bb5$1@.reader1.imaginet.fr...
> Hello,
> Some users create new databases using the enterprise manager console
(right
> click in the database section and then selecting new database).
> Once created this database has default settings like "Auto shrink" checked
> or "Auto close" unchecked (in the option tab).
> Is there a way to set these default settings so each time a new database
is
> created it has the right options?
> thanks
>
|||I could have searched a little more for this one I guess. Thanks!
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:OMxDsF9pEHA.2864@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
> Yes, set the correct options on the Model database. That database is the
> baseline from which all other databases on a server are created.
>
> <grille11@.yahoo.com> wrote in message
> news:cjju9f$bb5$1@.reader1.imaginet.fr...
> (right
checked
> is
>

default settings when creating a database

Hello,
Some users create new databases using the enterprise manager console (right
click in the database section and then selecting new database).
Once created this database has default settings like "Auto shrink" checked
or "Auto close" unchecked (in the option tab).
Is there a way to set these default settings so each time a new database is
created it has the right options?
thanksYes, set the correct options on the Model database. That database is the
baseline from which all other databases on a server are created.
<grille11@.yahoo.com> wrote in message
news:cjju9f$bb5$1@.reader1.imaginet.fr...
> Hello,
> Some users create new databases using the enterprise manager console
(right
> click in the database section and then selecting new database).
> Once created this database has default settings like "Auto shrink" checked
> or "Auto close" unchecked (in the option tab).
> Is there a way to set these default settings so each time a new database
is
> created it has the right options?
> thanks
>|||I could have searched a little more for this one I guess. Thanks!
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:OMxDsF9pEHA.2864@.TK2MSFTNGP12.phx.gbl...
> Yes, set the correct options on the Model database. That database is the
> baseline from which all other databases on a server are created.
>
> <grille11@.yahoo.com> wrote in message
> news:cjju9f$bb5$1@.reader1.imaginet.fr...
> > Hello,
> >
> > Some users create new databases using the enterprise manager console
> (right
> > click in the database section and then selecting new database).
> > Once created this database has default settings like "Auto shrink"
checked
> > or "Auto close" unchecked (in the option tab).
> > Is there a way to set these default settings so each time a new database
> is
> > created it has the right options?
> >
> > thanks
> >
> >
>