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

Friday, March 23, 2012

Is it possible to determine which user created a table?

I've come across a table in one of my databases that I don't remember
creating. Is it possible to tell which user created this table?Hello,
sp_help <tableName>
If the user create the table with DBO schema then the owner will be DBO and
it would be tough for you to identify the user who created the table.
Thanks
Hari
"Danielle" <wxbuff@.aol.com> wrote in message
news:1176065707.471519.177860@.p77g2000hsh.googlegroups.com...
> I've come across a table in one of my databases that I don't remember
> creating. Is it possible to tell which user created this table?
>|||Thanks Hari -
You were right... DBO is the owner. Not much to go on I'm afraid, but
that is a handy SP. Thanks for the tip.
Danielle|||On Apr 9, 2:00 pm, "Danielle" <wxb...@.aol.com> wrote:
> Thanks Hari -
> You were right... DBO is the owner. Not much to go on I'm afraid, but
> that is a handy SP. Thanks for the tip.
> Danielle
If you are on SQL 2005 you can use DDL triggers. I do this to track
all schema changes. You can look in "DDL Triggers" in BOL. I know when
my developers change tables, procs, views, fields etc.
Kristina|||On Apr 8, 4:55 pm, "Danielle" <wxb...@.aol.com> wrote:
> I've come across a table in one of my databases that I don't remember
> creating. Is it possible to tell which user created this table?
You can also use the information_schema.tables view
run this but change 'YourTableName' to the actual table name
select table_schema as ObjectOwner,table_name,*
from information_schema.tables
where table_name ='YourTableName'
Denis the SQL Menace
http://sqlservercode.blogspot.com/

Wednesday, March 21, 2012

Is it possible to create a schema or table from a dbf file instead of manully creating it

Is it possible to create a schema or table in sql server from a dbf file instead of manully creating it

Regards

Karen

Perhaps you can automate the Import process? I dont know what procs get called but you can profile the DTS Import/Export wizard and simluate that?

Monday, March 12, 2012

Is it possible that I change the data's type when I create the DSV in the Visual Studio 2005?

Hello everyone:

Recently, I was responsible for creating a analysis services project with the SQL Server Business Intelligence Development Studio in Visual studio 2005. I encountered a error that the data type is not supported when I tried to add the table from a remote Oracle server. I can not modify the data type in the oracle server. Is it possible that I change the data's type when I create the DSV in the Visual Studio 2005? (if I have known the table's name)

Help me Please! tell me the steps or some references if it is possible

Thanks


While I don't think you can change the data type of the column within the DSV, what you can do is add a named calculation to the table within the DSV and use a snippet of Oracle to cast the underlying column to whatever data type you want. The new named calculation would then inherit that data type.

For example (using SQL Server here, not Oracle), if I had a table with a column named ZIPCODE of type INT but I wanted to treat the column as VARCHAR within my SSAS solution, I could add a new named calculation to the table within the DSV (right-click on the table in the DSV and select New Named Calculation), call it something like ZIPCODE_STR and then use the T-SQL snippet CONVERT(VARCHAR(10), ZIPCODE). This new column then behaves like any other within the DSV and within the rest of my solution -- and has a datatype of System.String with a length of 10.

HTH,

Dave Fackler

|||

Thank you very much

Now I did not install SQL Server 2005 and VS on current computer, I will try it later. I think you suggest is very well. But I have a question: you said I could add a new name calculation to the table within the DSV. Does it equal that the table (at least one column's datatype doesn't not match the SSAS's rule) have been added into the DSV?

The problem I encounter is that I can not add that table to the DSV because of the unsuited the datatype for the column. Is there any other suggestion to me?

Thanks^_^

|||

Sorry, I missed the point that you can't add the table to the DSV because of the data type...

In that case, instead of adding a named calculation to the table (as you are correct in thinking that the table must be present within the DSV to do this), add a named query instead. Just right-click on the design surface of the DSV and select New Named Query.

This will bring up a dialog box that you can use to enter any PL/SQL select statement (given you are using Oracle) returning whatever columns (converted to whatever datatypes you need) from one or more tables. Very similar to creating a view in the Oracle database. Just give the named query a name and it will then appear as a table within the DSV. So, in your case, you'd likely want to select all the relevant columns that you need, converting the one with the unsupported datatype to another datatype (just be sure to alias the column once you convert it as a named query must return named columns so that the DSV can understand the metadata returned by the query).

HTH,

Dave Fackler

|||

I think this response is I need. Thank~ you very much.

I will try it later.

Thanks^_^

Winnie

Is it possible that I change the data's type when I create the DSV in the Visual Studio 200

Hello everyone:

Recently, I was responsible for creating a analysis services project with the SQL Server Business Intelligence Development Studio in Visual studio 2005. I encountered a error that the data type is not supported when I tried to add the table from a remote Oracle server. I can not modify the data type in the oracle server. Is it possible that I change the data's type when I create the DSV in the Visual Studio 2005? (if I have known the table's name)

Help me Please! tell me the steps or some references if it is possible

Thanks


While I don't think you can change the data type of the column within the DSV, what you can do is add a named calculation to the table within the DSV and use a snippet of Oracle to cast the underlying column to whatever data type you want. The new named calculation would then inherit that data type.

For example (using SQL Server here, not Oracle), if I had a table with a column named ZIPCODE of type INT but I wanted to treat the column as VARCHAR within my SSAS solution, I could add a new named calculation to the table within the DSV (right-click on the table in the DSV and select New Named Calculation), call it something like ZIPCODE_STR and then use the T-SQL snippet CONVERT(VARCHAR(10), ZIPCODE). This new column then behaves like any other within the DSV and within the rest of my solution -- and has a datatype of System.String with a length of 10.

HTH,

Dave Fackler

|||

Thank you very much

Now I did not install SQL Server 2005 and VS on current computer, I will try it later. I think you suggest is very well. But I have a question: you said I could add a new name calculation to the table within the DSV. Does it equal that the table (at least one column's datatype doesn't not match the SSAS's rule) have been added into the DSV?

The problem I encounter is that I can not add that table to the DSV because of the unsuited the datatype for the column. Is there any other suggestion to me?

Thanks^_^

|||

Sorry, I missed the point that you can't add the table to the DSV because of the data type...

In that case, instead of adding a named calculation to the table (as you are correct in thinking that the table must be present within the DSV to do this), add a named query instead. Just right-click on the design surface of the DSV and select New Named Query.

This will bring up a dialog box that you can use to enter any PL/SQL select statement (given you are using Oracle) returning whatever columns (converted to whatever datatypes you need) from one or more tables. Very similar to creating a view in the Oracle database. Just give the named query a name and it will then appear as a table within the DSV. So, in your case, you'd likely want to select all the relevant columns that you need, converting the one with the unsupported datatype to another datatype (just be sure to alias the column once you convert it as a named query must return named columns so that the DSV can understand the metadata returned by the query).

HTH,

Dave Fackler

|||

I think this response is I need. Thank~ you very much.

I will try it later.

Thanks^_^

Winnie

Is it Possible ?

Creating website in C# using Visual Studio 2005

Hi want to have something done, just to make sure if a such a thing can be done or not. I have a table in the Sql server 2005 called users. This contains all the users with usernames and passwords.

Now have another table called absent. In it there are 3 fields ID (autonumber),Username and Date.

Say if a user is absent. it will check the table user for their respected username, next it will go to another table called attendance in which consists of the username date, time in and timeout.

If the user has not signed in for today at 3pm in the afternoon then it should save the details in the absent table.

--------------

User table has user - Kevin

Now if kevin does notsign in the webform, after 3pm in the afternoon, the sql server must save the entry kevin with the date in the absent column.

The part in bold basically means to check if the user details are present for todays date in another table called Attendance for that user

Similarly if there are other users then same steps

--------------

I hope i clarified it

Thanks for your help

Sheldon

Create a job in SqlServer Agent, set up runtime at 3:00 PM every day. The job updates the tables based on your conditions.

|||Hi again thanks but you could post some more help or some links which deals with this|||

1). create a SP to carry out your task -- Update tables

2). In SqlServer Management-Jobs, create a job to execute this SP

Here is a reference that show you how to create a job.http://www.quackit.com/sql_server/tutorial/sql_server_agent_jobs.cfm

Google SqlServer Agent Jobs for help.