|
|
-
|
|
Just found that all the below queries will return current database name.
[CODE]
SELECT DB_NAME(0)
SELECT DB_NAME()
SELECT DB_NAME('')
[/CODE]......
|
|
-
|
|
Hi you can protect you back up files using password
[code]
Backup database test to disk='D:\Protectedfile.bak' with password='E#$8234$'
[/code]
This prevent the restore of database with out supplying same password......
|
|
-
10 Liked
| 6 Learned
| 13 Comments
|
|
As sharing my experience while using SP_HELPTEXT to get stored procedure text in SQL Server and ran into issue.
Issue 1. It will remove setting of the stored procedures like "set quoted_identifier on" or any other if using at the top of the stored ......
|
|
-
|
|
It is not possible to mirror master, msdb, model or temp databases.......
|
|
-
10 Liked
| 11 Learned
| 5 Comments
|
|
While the following is not valid
[code]SELECT SYSDATETIME()-SYSDATETIME()[/code]
the following is valid
[code]SELECT SYSDATETIME()-GETDATE()[/code]......
|
|
-
|
|
Inorder to change the owner of the table to dbo, we can do like this.
[code]
sp_changeobjectowner '<tablename>', 'dbo'
GO
[/code]......
|
|
-
|
|
If you come across the following error while running a T-SQL query or executing a stored procedure or in a SSIS package execution which states:
"The transaction log for database 'DatabaseName' is full. To find out why space in the log cannot be reuse......
|
|
-
|
|
You wanna create your picture in SQL? It is possible using geometry datatype. Only thing you get your picture in SVG format and get the values for geomerty. It would enbale the spatial result tab in SSMS and show your picture. (Read the comments especia......
|
|
-
|
|
we can get database name list with following methods.
Method#1
[code]
Use master
select db_name(database_id) as Name from sys.master_files where file_id=1
GO
[/code]
Method#2
[Code]
Use master
select db_name(dbid) as Name from sys.sysa......
|
|
-
|
|
While trying to send mail via database mail option, encountered this error
' EXECUTE permission was denied on the object 'sp_send_dbmail', database 'msdb', schema 'dbo'.'
Fix: From the message it was clear that it needs permission to msdb databa......
|
|