Dear Expert,
By using stored procedure sp_spaceused, I created an sql script to list the spaces used by all tables in a particular database.
Now my boss asks me to modify the script to a stored procedure so it can list the spaces used by all tables in any given database.
I created a stored...
Hi, Expert
I have a database backup plan. It does all user databases backups and transaction logs backups. The databases full backups are scheduled at 11:30pm daily. The transaction logs backups are scheduled at 12:00pm daily. Both backup files older than 2 days will be removed. The databases...
Dear Expert,
Is it possible to change a database owner to sa?
I created a new database by restoring from a database backup. The owner of the existing database is sa. But the owner of the new database is ATHENA\Administrator. (Here ATHENA is the server name). How do I make the new database to...
Dear Export,
After I created a new database, should I create a db role first or create a db user first?
A Login for the db user exists already.
Is there an easy way to copy users/roles from one database to another?
Thanks
Dear Expert,
The job execute a batch file below:
=====================
osql -E -d tenrox_dev -n -b -i "c:\sama data\mssql\script files\tenrox\g_alter_user_sp.sql"
echo Alter Stored Procedures(type User) completed
=====================
Everything worked fine until I add two lines, date and...
Dear Expert,
Followed the instructions below I copied the user and roles from one database to another. But the permissions of the roles were not be copied over. Is there a way to copy the permissions of the roles over?
Thanks
=====================
In Enterprise Manager
Right Click on your...
Hi Denis,
I think that 'run the script twice for the procs' does not solve my problem because there are drop procedure statements in the script. Also all the drop statements are executed before executing create procedures statements.
If I do not drop a procedure will SQL lets me create a new...
Hi Jim,
Follow your instructions I copied Views successfully from one database to another. But when I tried to copy Stored Procedures I got many messages like the following:
Cannot add rows to sysdepends for the current stored procedure because it
depends on the missing object...
Dear Expert,
I need to copy all views from one database to another in the same SQL server. Can I create a SQL program to do it?
If I pick all view names from sysobjects table, how do I avoid picking the system views?
Thanks
Dear Expert,
I try to create a job for a query. I got an error message:
The specified file is 4181 characters in size,which is larger than the available free space in the current job Step command(3200 characters).
Do you want to continue opening this file but have its contents truncated.
Is...
Dear Expert,
I use BCP to export data from tables in one database and then import the data files to the same tables in another database with different collation.
What is the row order in the data files exported from a table? Should the row order in destination table have the same order as in...
Dear Experts,
With your help, I successfully used BCP to export data to files(csdata files) from all tables in a database(collation is case sensitive) and then import the csdata files to another database(collation is case insensitive).
Now I need to verify that the data in both databases are...
Thanks! I will follow your suggestions and do more test.
There are two languages, English and French in Char. fields. If I keep the same code page ACP, some French letters are not converted correctly. I use RAW in import (it means no convention from one code page to another occurs during the...
Dear Expert,
I use BCP to export data from tables in a database, then import the data files to the same tables in another database.
I had trouble to import data to a table. The table definition is:
CREATE TABLE [dbo].[TWORKFLOWMAPXMLDEF] (
[ORGANIZATIONID] [int] NOT NULL ,
[UNIQUEID] [int]...
I don't know how to view data in Hex codes in DOS environment. But I did upload the data file to a HP mainframe. I used fcopy command to view the data in Hex code. There is no CR or LF but blanks for the extra rows. How comes there is no Hex codes for the extra rows? Anyway, I deleted the extra...
Dear Expert,
I have a table created as following:
CREATE TABLE [dbo].[TMAPDATA] (
[ORGANIZATIONID] [int] NOT NULL ,
[TABLENAME] [varchar] (32) COLLATE Latin1_General_CS_AS NOT NULL ,
[FIELDKEY] [varchar] (80) COLLATE Latin1_General_CS_AS NOT NULL ,
[LANGUAGE] [smallint] NOT NULL ...
Dear expert,
I have to change a database collation from case sensitive to case insensitive. So I need to develop queries to find all potential duplicates in unique indexes and primary keys. A query to find all potential duplicates in primary keys is done (refer to sp_pkeys stored procedure). But...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.