Showing posts with label value. Show all posts
Showing posts with label value. Show all posts

Wednesday, March 28, 2012

Relationship to UserId

Hi there everyone, this is my first post so go easy on me :)

Basically I am trying to get my database to copy the value in the UserId (unique identifier field) from the aspnet_Users table to a foreign key UserId in a table called userclassset. I have made this field the same datatype and created a relationship between the two. Unfortunately, when I add a user using the ASP.Net configuration tool it does not automatically copy this value into my own custom table. I have noticed it is however automatically copied into the aspnet_Membership table. Any pointers on how to solve this would be great!

Thanks :)

ascension:

?I have noticed it is however automatically copied into the aspnet_Membership table. Any pointers on how to solve this would be great!

This is because when you?use?.NET2.0?built-in?function?to create user,?the?aspnet_Users_CreateUser?stored?procedure?is?called.?This?stored?procedure?will?not?only?insert?a?row?in?aspnet_users?table,?but?also?do?some?operations?on?aspnet_Memebership?table,?you?can?use?sp_helptext?to?view?the?definition:

sp_helptext aspnet_Users_CreateUser

So if you want to insert some row into your own custom table, you can either: alter the aspnet_Users_CreateUser to add your own statements (preferred); orcreate a?insert trigger?on?the?aspnet_users?table|||Brilliant, worked perfectly. Thanks :)

Monday, March 26, 2012

Relations without contrains

If I created relation between 2 tables without any constarins what will be the value of this relation or when SQL Server will use this relationI'm not sure what you mean. When you create a relation there is always a constraint being created.sql

Relations without contrains

If I created relation between 2 tables without any constarins what will be the value of this relation or when SQL Server will use this relationI'm not sure what you mean. When you create a relation there is always a constraint being created.

Friday, March 9, 2012

Regular Expression?

I need to remove all the [ and ] in every sql stmt where they are used
to close encircling numeric value, fyi, all these sql stmt are
converted from an Access db. For instance,
select *
from XYZtbl
where fieldA = [1] or fieldA = [2] or fieldA = [3]

to be
select *
from XYZtbl
where fieldA = 1 or fieldA = 2 or fieldA = 3

-- and of course I'd have written in as follows, but that's not
-- the point
select *
from XYZtbl
where fieldA IN (1,2,3)

Thanks.Hi

If you are generating these queries dynamically they should be removed in
the code that generates them.

You can not change the query once it has been sent to the server unless you
write your own driver, therefore you will have to change the source. You may
want to create stored procedures from these queries rather than use ad-hoc
queries.

John

"NickName" <dadada@.rock.com> wrote in message
news:1125970738.466448.247370@.g14g2000cwa.googlegr oups.com...
> I need to remove all the [ and ] in every sql stmt where they are used
> to close encircling numeric value, fyi, all these sql stmt are
> converted from an Access db. For instance,
> select *
> from XYZtbl
> where fieldA = [1] or fieldA = [2] or fieldA = [3]
> to be
> select *
> from XYZtbl
> where fieldA = 1 or fieldA = 2 or fieldA = 3
> -- and of course I'd have written in as follows, but that's not
> -- the point
> select *
> from XYZtbl
> where fieldA IN (1,2,3)
> Thanks.|||On 5 Sep 2005 18:38:58 -0700, NickName wrote:

>I need to remove all the [ and ] in every sql stmt where they are used
>to close encircling numeric value, fyi, all these sql stmt are
>converted from an Access db. For instance,
>select *
>from XYZtbl
>where fieldA = [1] or fieldA = [2] or fieldA = [3]
>to be
>select *
>from XYZtbl
>where fieldA = 1 or fieldA = 2 or fieldA = 3
>-- and of course I'd have written in as follows, but that's not
>-- the point
>select *
>from XYZtbl
>where fieldA IN (1,2,3)
>Thanks.

Hi NickName,

Where are these queries stored?
SQL Server doesn't store actual queries - it accepts them, executes
them, then returns you the results.
On the other hand, the code for stored procedures, user-defined
functions and triggers is stored in SQL Server.

If you have your queries stored in files on your computer, check
www.tucows.com for a freeware or shareware GREP-like utility to quickly
make the change for you (but beware that you specify the regular
expression patterns in a way to prevent unwanted side-effects!!)

If this is code in stored procedures etc, then there is no easy way to
change it all at once. You'll either have to change the procedures one
by one (which is a good opportunity to bring them all in some change
control system), or investigate what went wrong on the conversion from
Access, fix that problem, then re-convert.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)|||Hi Hugo,

These are 'saved' queries in Access I'm in the process of converting
them to either View or SP, and obviously SQL Server would accept
something like
select *
from XYZtbl
where fieldA = [1] or fieldA = [2] or fieldA = [3]

I thought about GREP but wanted to check if there's other option.

On Access conversion, it convert queries to virtual tables.

Thanks.

Don|||"If you are generating these queries dynamically they should be removed
in
the code that generates them."
Exactly, that's what I wanted to do in the generation/conversion
process.

"You may
want to create stored procedures from these queries rather than use
ad-hoc
queries. "
Yes, either view or sp.

Thanks.|||Hi

Then you should look at the search/replace functionality of a text editor or
even Query Analyser.

I have not come across this thing before in access queries, so I am not sure
why they are there.

John

"NickName" <dadada@.rock.com> wrote in message
news:1126045915.321908.319130@.g49g2000cwa.googlegr oups.com...
> "If you are generating these queries dynamically they should be removed
> in
> the code that generates them."
> Exactly, that's what I wanted to do in the generation/conversion
> process.

> "You may
> want to create stored procedures from these queries rather than use
> ad-hoc
> queries. "
> Yes, either view or sp.
> Thanks.

Wednesday, March 7, 2012

Registry to store configuration values ?

I try to store a SSIS-configuration value in the registry.

But it's failed. I get a warning, that the registry-key is not found.

What is the syntax ? I have searched in BO,MSDN and Google/Internet ==> nothing.

There is no example.

The syntax of how to specify the name of the registry key is straightforward. See BOL: ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/uirfsql9/html/212e52e7-27a7-48bb-8bad-34aa290d2003.htm

If you're asking how to define the syntax of a configuration (i.e. The thing that should be IN the registry key) then that's a bit more difficult. A quick scan of BOl didn't bring anything up. The way I always do it is to create an XML COnfiguration file from within SSIS Designer and then copy and paste the resultant configuration into the registry key.

Hope that halps.

-Jamie

|||

Hey Jamie,

there is no example:

Configuration Type Option = Registry Entry
Specify configuration settings directly
Use to specify settings directly.

Value Description
Registry entry
Type the registry key that contains the configuration information.

I think it is very easy, but I don't know how to type the registry key!

With regedit I have defined a new entry:

HKEY_LOCAL_MACHINE\SOFTWARE\SSIS\Var

Var is a string and contains for example the servername.

What is the syntax in the SSIS-Configuration-Wizard?

You create an XML-Configuration file then you copy and paste the result into the registry key?

The registry key can store only one proberty. The XML-Configuration can store many proberties. You have an example?

Thanks

Loom

|||

It sounds to me as though you have done everything that you need to do. What error are you getting when you try and usee it?

-Jamie

|||

In the german version I get this warning:

Warnung: 0x80012015 bei Package: Der Konfigurationsregistrierungsschlüssel 'HKEY_LOCAL_MACHINE\SOFTWARE\SSIS\Var' wurde nicht gefunden. Für einen Konfigurationseintrag ist ein nicht verfügbarer Registrierungsschlüssel angegeben. überprüfen Sie die Registrierung, und stellen Sie sicher, dass der Schlüssel vorhanden ist.

Translation:

The Configuration-Registry-Key 'HKEY_LOCAL_MACHINE\SOFTWARE\SSIS\Var' was not found.

Loom

|||

The key must be defined in HKCU.

The Value must be stored in the Value key.

HKCU\Configuration\FirstConfig\Value

HKCU\Configuration\SecondConfig\Value

The ConfigString is Configuration\FirstConfig , this is the string you put into the Configuration String field in the Configuration Wizard.

The Registry Configuration assumes the HKCU and Value sections. Everything in between can be whatever you want.

HTH,

K

|||

Kirk,

Is this information in BOL anywhere? If it isn't, it should be.

-Jamie

|||Nah, don't think so. I couldn't find it anywhere...|||

Bingo!

I have tried everything, but not the value key....

To store the configuration in the registry has an advantage compared with an environment-variable. A change in the registry automaticly change your configuration.

A change of an environment-variable has no effect in the BI-Studio. The only way to refresh the variable is: Close the BI-Studio and then reopen it.

And this is a problem for a developer. Environment-variables are not the first choice for switching between Dev / Test / Pro - Servers.

Or I have missed something?

Loom

|||

You're right that you need to shut down BIDS for the EV Config to take effect, but, why does that matter? You can simply change the value of the configured property as though the configuration had been applied.

Again, it's a preference thing. That's why there are several options.

Environment Variables are the only option for Indirect Configurations.

K

|||

There is another option for Indirect Configuration: The SQL-Server option.

The SQL-Server use a normal connection-manager and you can configure the proberties of this connection-manager.

In the FirstConfig you can change the ServerName and the InitialCatalog of the connection-manager.

In the SecondConfig you use the SQL-Server-Option with the changed ServerName/InitialCatalog.

In my opinion it is an indirect configuration too.

Loom

|||

Yep, got that right. Very flexible, yes.

K

|||

Loom wrote:

Bingo!

I have tried everything, but not the value key....

To store the configuration in the registry has an advantage compared with an environment-variable. A change in the registry automaticly change your configuration.

A change of an environment-variable has no effect in the BI-Studio. The only way to refresh the variable is: Close the BI-Studio and then reopen it.

And this is a problem for a developer. Environment-variables are not the first choice for switching between Dev / Test / Pro - Servers.

Or I have missed something?

Loom

Its a matter of opinion isn't it? there isn't one right answer. Personally I think the issue about having to close BIDS isn't really a problem as long as you know about the issue.

I use indirect configurations exclusively. That's just my choice.

-Jamie

|||

I try to use this option to change the "conenction string" property of a Flat file connection, but nothing happens.

What is the correct format of registry Key string to fill the box?

I try :

HKEY_LOCAL_MACHINE\SOFTWARE\ProjectName\Connections\ConnectionString1

and

[HKEY_LOCAL_MACHINE\SOFTWARE\ProjectName\Connections\ConnectionString1]

and

"HKEY_LOCAL_MACHINE\SOFTWARE\ProjectName\Connections\ConnectionString1"

The value Key "ConnectionString1" is a String Value that contains the address of file like: C:\input files\Test.csv

Don't Work!!!! What′s wrong?

Thanks

|||

In the registry you have this entry:

HKEY_LOCAL_MACHINE\SOFTWARE\ProjectName\Connections\ConnectionString1\value

In Value you store your connection string

In the SSIS-Configuration the reference is:

SOFTWARE\ProjectName\Connections\ConnectionString1

Loom

Registry to store configuration values ?

I try to store a SSIS-configuration value in the registry.

But it's failed. I get a warning, that the registry-key is not found.

What is the syntax ? I have searched in BO,MSDN and Google/Internet ==> nothing.

There is no example.

The syntax of how to specify the name of the registry key is straightforward. See BOL: ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/uirfsql9/html/212e52e7-27a7-48bb-8bad-34aa290d2003.htm

If you're asking how to define the syntax of a configuration (i.e. The thing that should be IN the registry key) then that's a bit more difficult. A quick scan of BOl didn't bring anything up. The way I always do it is to create an XML COnfiguration file from within SSIS Designer and then copy and paste the resultant configuration into the registry key.

Hope that halps.

-Jamie

|||

Hey Jamie,

there is no example:

Configuration Type Option = Registry Entry
Specify configuration settings directly
Use to specify settings directly.

Value Description
Registry entry
Type the registry key that contains the configuration information.

I think it is very easy, but I don't know how to type the registry key!

With regedit I have defined a new entry:

HKEY_LOCAL_MACHINE\SOFTWARE\SSIS\Var

Var is a string and contains for example the servername.

What is the syntax in the SSIS-Configuration-Wizard?

You create an XML-Configuration file then you copy and paste the result into the registry key?

The registry key can store only one proberty. The XML-Configuration can store many proberties. You have an example?

Thanks

Loom

|||

It sounds to me as though you have done everything that you need to do. What error are you getting when you try and usee it?

-Jamie

|||

In the german version I get this warning:

Warnung: 0x80012015 bei Package: Der Konfigurationsregistrierungsschlüssel 'HKEY_LOCAL_MACHINE\SOFTWARE\SSIS\Var' wurde nicht gefunden. Für einen Konfigurationseintrag ist ein nicht verfügbarer Registrierungsschlüssel angegeben. überprüfen Sie die Registrierung, und stellen Sie sicher, dass der Schlüssel vorhanden ist.

Translation:

The Configuration-Registry-Key 'HKEY_LOCAL_MACHINE\SOFTWARE\SSIS\Var' was not found.

Loom

|||

The key must be defined in HKCU.

The Value must be stored in the Value key.

HKCU\Configuration\FirstConfig\Value

HKCU\Configuration\SecondConfig\Value

The ConfigString is Configuration\FirstConfig , this is the string you put into the Configuration String field in the Configuration Wizard.

The Registry Configuration assumes the HKCU and Value sections. Everything in between can be whatever you want.

HTH,

K

|||

Kirk,

Is this information in BOL anywhere? If it isn't, it should be.

-Jamie

|||Nah, don't think so. I couldn't find it anywhere...|||

Bingo!

I have tried everything, but not the value key....

To store the configuration in the registry has an advantage compared with an environment-variable. A change in the registry automaticly change your configuration.

A change of an environment-variable has no effect in the BI-Studio. The only way to refresh the variable is: Close the BI-Studio and then reopen it.

And this is a problem for a developer. Environment-variables are not the first choice for switching between Dev / Test / Pro - Servers.

Or I have missed something?

Loom

|||

You're right that you need to shut down BIDS for the EV Config to take effect, but, why does that matter? You can simply change the value of the configured property as though the configuration had been applied.

Again, it's a preference thing. That's why there are several options.

Environment Variables are the only option for Indirect Configurations.

K

|||

There is another option for Indirect Configuration: The SQL-Server option.

The SQL-Server use a normal connection-manager and you can configure the proberties of this connection-manager.

In the FirstConfig you can change the ServerName and the InitialCatalog of the connection-manager.

In the SecondConfig you use the SQL-Server-Option with the changed ServerName/InitialCatalog.

In my opinion it is an indirect configuration too.

Loom

|||

Yep, got that right. Very flexible, yes.

K

|||

Loom wrote:

Bingo!

I have tried everything, but not the value key....

To store the configuration in the registry has an advantage compared with an environment-variable. A change in the registry automaticly change your configuration.

A change of an environment-variable has no effect in the BI-Studio. The only way to refresh the variable is: Close the BI-Studio and then reopen it.

And this is a problem for a developer. Environment-variables are not the first choice for switching between Dev / Test / Pro - Servers.

Or I have missed something?

Loom

Its a matter of opinion isn't it? there isn't one right answer. Personally I think the issue about having to close BIDS isn't really a problem as long as you know about the issue.

I use indirect configurations exclusively. That's just my choice.

-Jamie

|||

I try to use this option to change the "conenction string" property of a Flat file connection, but nothing happens.

What is the correct format of registry Key string to fill the box?

I try :

HKEY_LOCAL_MACHINE\SOFTWARE\ProjectName\Connections\ConnectionString1

and

[HKEY_LOCAL_MACHINE\SOFTWARE\ProjectName\Connections\ConnectionString1]

and

"HKEY_LOCAL_MACHINE\SOFTWARE\ProjectName\Connections\ConnectionString1"

The value Key "ConnectionString1" is a String Value that contains the address of file like: C:\input files\Test.csv

Don't Work!!!! What′s wrong?

Thanks

|||

In the registry you have this entry:

HKEY_LOCAL_MACHINE\SOFTWARE\ProjectName\Connections\ConnectionString1\value

In Value you store your connection string

In the SSIS-Configuration the reference is:

SOFTWARE\ProjectName\Connections\ConnectionString1

Loom

Registry to store configuration values ?

I try to store a SSIS-configuration value in the registry.

But it's failed. I get a warning, that the registry-key is not found.

What is the syntax ? I have searched in BO,MSDN and Google/Internet ==> nothing.

There is no example.

The syntax of how to specify the name of the registry key is straightforward. See BOL: ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/uirfsql9/html/212e52e7-27a7-48bb-8bad-34aa290d2003.htm

If you're asking how to define the syntax of a configuration (i.e. The thing that should be IN the registry key) then that's a bit more difficult. A quick scan of BOl didn't bring anything up. The way I always do it is to create an XML COnfiguration file from within SSIS Designer and then copy and paste the resultant configuration into the registry key.

Hope that halps.

-Jamie

|||

Hey Jamie,

there is no example:

Configuration Type Option = Registry Entry
Specify configuration settings directly
Use to specify settings directly.

Value Description
Registry entry
Type the registry key that contains the configuration information.

I think it is very easy, but I don't know how to type the registry key!

With regedit I have defined a new entry:

HKEY_LOCAL_MACHINE\SOFTWARE\SSIS\Var

Var is a string and contains for example the servername.

What is the syntax in the SSIS-Configuration-Wizard?

You create an XML-Configuration file then you copy and paste the result into the registry key?

The registry key can store only one proberty. The XML-Configuration can store many proberties. You have an example?

Thanks

Loom

|||

It sounds to me as though you have done everything that you need to do. What error are you getting when you try and usee it?

-Jamie

|||

In the german version I get this warning:

Warnung: 0x80012015 bei Package: Der Konfigurationsregistrierungsschlüssel 'HKEY_LOCAL_MACHINE\SOFTWARE\SSIS\Var' wurde nicht gefunden. Für einen Konfigurationseintrag ist ein nicht verfügbarer Registrierungsschlüssel angegeben. überprüfen Sie die Registrierung, und stellen Sie sicher, dass der Schlüssel vorhanden ist.

Translation:

The Configuration-Registry-Key 'HKEY_LOCAL_MACHINE\SOFTWARE\SSIS\Var' was not found.

Loom

|||

The key must be defined in HKCU.

The Value must be stored in the Value key.

HKCU\Configuration\FirstConfig\Value

HKCU\Configuration\SecondConfig\Value

The ConfigString is Configuration\FirstConfig , this is the string you put into the Configuration String field in the Configuration Wizard.

The Registry Configuration assumes the HKCU and Value sections. Everything in between can be whatever you want.

HTH,

K

|||

Kirk,

Is this information in BOL anywhere? If it isn't, it should be.

-Jamie

|||Nah, don't think so. I couldn't find it anywhere...|||

Bingo!

I have tried everything, but not the value key....

To store the configuration in the registry has an advantage compared with an environment-variable. A change in the registry automaticly change your configuration.

A change of an environment-variable has no effect in the BI-Studio. The only way to refresh the variable is: Close the BI-Studio and then reopen it.

And this is a problem for a developer. Environment-variables are not the first choice for switching between Dev / Test / Pro - Servers.

Or I have missed something?

Loom

|||

You're right that you need to shut down BIDS for the EV Config to take effect, but, why does that matter? You can simply change the value of the configured property as though the configuration had been applied.

Again, it's a preference thing. That's why there are several options.

Environment Variables are the only option for Indirect Configurations.

K

|||

There is another option for Indirect Configuration: The SQL-Server option.

The SQL-Server use a normal connection-manager and you can configure the proberties of this connection-manager.

In the FirstConfig you can change the ServerName and the InitialCatalog of the connection-manager.

In the SecondConfig you use the SQL-Server-Option with the changed ServerName/InitialCatalog.

In my opinion it is an indirect configuration too.

Loom

|||

Yep, got that right. Very flexible, yes.

K

|||

Loom wrote:

Bingo!

I have tried everything, but not the value key....

To store the configuration in the registry has an advantage compared with an environment-variable. A change in the registry automaticly change your configuration.

A change of an environment-variable has no effect in the BI-Studio. The only way to refresh the variable is: Close the BI-Studio and then reopen it.

And this is a problem for a developer. Environment-variables are not the first choice for switching between Dev / Test / Pro - Servers.

Or I have missed something?

Loom

Its a matter of opinion isn't it? there isn't one right answer. Personally I think the issue about having to close BIDS isn't really a problem as long as you know about the issue.

I use indirect configurations exclusively. That's just my choice.

-Jamie

|||

I try to use this option to change the "conenction string" property of a Flat file connection, but nothing happens.

What is the correct format of registry Key string to fill the box?

I try :

HKEY_LOCAL_MACHINE\SOFTWARE\ProjectName\Connections\ConnectionString1

and

[HKEY_LOCAL_MACHINE\SOFTWARE\ProjectName\Connections\ConnectionString1]

and

"HKEY_LOCAL_MACHINE\SOFTWARE\ProjectName\Connections\ConnectionString1"

The value Key "ConnectionString1" is a String Value that contains the address of file like: C:\input files\Test.csv

Don't Work!!!! What′s wrong?

Thanks

|||

In the registry you have this entry:

HKEY_LOCAL_MACHINE\SOFTWARE\ProjectName\Connections\ConnectionString1\value

In Value you store your connection string

In the SSIS-Configuration the reference is:

SOFTWARE\ProjectName\Connections\ConnectionString1

Loom