Quantcast
Channel: SQL Server Database Engine Forum
Viewing all 15872 articles
Browse latest View live

Run Job on Different server and get the results back and go to next step

$
0
0

Hi All,

I have a small query. I have a Server where we run all our job for clients. due to some internal constraints now we need to kick of a job on different server(server b) as part of the job on server(server a).

I need to wait for results(the job to complete on server b) before i go to next step in server a.

Is this possible?


Thanks & Regards,
Manjunath C Bhat,
http://manjunathcbhat.blogspot.com
http://manjunathcbhat.wordpress.com


Restore script T-SQL to new database name on same server

$
0
0

Quick question regarding how to script a restore to a new database name on the same database server host using T-SQL commands/script.

Environment is MS SQL Server 2012 on Windows 2012 Server

1. I have copy only database backups that do a copy only backup to a drive C:\backups\database_date.bak

2. I want to write a T-SQL script to grab the backup file and restore to a new database name from database A to database_newname

so that I don't overwrite the existing database on the server during the restore. Sort of a refresh on same host to new database name for test purposes.

How would I do this in T-SQL?

Network Performance Analysis for SQL Server

$
0
0

Hi Folks,

I need to analyse network performance for one of our SQL database server. I searched many blogs and articles on internet in which I found the perfmon counters need to set for network performance analysis but I didn't find complete threshold values for all the counters. In absence of threshold values I am not able to conclude anything about network performance. Can anyone help me out with threshold values for below network performance counters, also let me know if these counters are sufficient to conclude anything or do I need more counters;

Network InterfaceBytes Total/sec
Network InterfaceBytes Received/sec
Network InterfaceBytes Sent/sec
ServerBytes Total/sec
Processor% Interrupt Time
Network Interface(*)Output Queue Length

Thanks in advance

AO-AG Unable to configure default port for Listener

$
0
0

Hello all,we have AlwaysOn AG configuration.

2 Servers 3 instances all instances are currently on node 2.

Servers are in cluster and we have 3 virtual servers (IP's) for all 3 listeners.
For Instance 2 and 3 we have working listener with default port 1433 but not able to set it for instance1 getting error >

It is possible to config. listener with port for example: 1435 but we need 1433, like it is for other two instances.

Getting also errors in error log like>
Date        19/09/2018 13:25:21
Log        SQL Server (Current - 19/09/2018 13:24:00)

Source        Server

Message
Server TCP provider failed to listen on [ XXX.24 <ipv4> 1433]. Tcp port is already in use.

But when checking "netstat -ano" I don't see any process using this port for this IP

Any advice please?




SQL Server Internals training

Copy Database Wizard. Where is the package created?

$
0
0

Hi guys, I am using the copy database wizard. It works correctly so far but I need to update something in the package (not in the job). Any idea where the package is stored?

Besides, if I open the job I don't see the package set in the window (however, if I cancel and run the package works)

Where can I find prepared SQL statements (sp_prepare) in the system tables/views?

$
0
0

Environment: SQL Server 2014 on Windows Server 2012 R2.

Our application uses hibernate and the jTDS JDBC driver, so we are (by default) getting generated SQL statements coming through as sp_prepare and sp_execute.  Sometimes, I am able to find the prepared queries in the cache, but sometimes I'm not.  By cache, I mean sys.dm_exec_query_stats and sys._dm_exec_cached_plans.  What's strange is that even if they seem to be gone from the cache, the prepared statements execute successfully.  I'm wondering if there is some other location where I could consistently see/find the prepared statements, hopefully by their integer handle?

Thank you,

-Peter

Problem to connect

$
0
0
Dear,
I've enabled TCP port 61240 on server but I've still got

TITLE: Connect to Server
------------------------------

Cannot connect to WIN-APIUFD1NJEU,61240.

------------------------------
ADDITIONAL INFORMATION:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The wait operation timed out.) (Microsoft SQL Server, Error: 258)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=258&LinkId=20476

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

The wait operation timed out

------------------------------
BUTTONS:

OK
------------------------------



why?

Many Thanks & Best Regards, Hua Min


Reg: Usage of Return Statement In SQL Server

$
0
0

Hi Experts,

Can i use Return Statement as abort the sql server execution flow ?

what are the other usages for Return Statement in sql server?

Thanks.


Alert for Database size using trigger

$
0
0

Hi,

I want to set the alert for database when its size grows beyond threshold value (ex:- 500 GB)

& want to do it using database trigger. so that when its size is grows beyond 500 gb, databse trigger will produce alert only one time.

is it possible? how to do it?

Please help me.

Reg: Difference Between Implicit and explicit Transactions in SQL Server..

$
0
0

Hi Experts,

can i know briefly about implicit and explicit transactions in sql server ?

what are the impacts of those in  dead locks in sql server?

Thanks ,

Venakata Vara

Why Error 5118? My disk is not compressed?

$
0
0
Hi all,

I encountered problems like the one ever posted here and in the forum SQL Server Tools.
In one case, the user solved the problem by turning dynamic disk into static (basic) disks.
In another case, the soution was not known.

Here is the message I encountered.

Msg 5118, Level 16, State 1, Line 1

The file "E:\Database\Microsoft\Usage.mdf" is compressed but does not reside in a read-only database or filegroup. The file must be decompressed.

The problem is : my disk is static (basic), and not compressed. How can this happen?
I also have Oracle installed. Oracle instance is able to process files in the disk E.
Again, the disk E is not compressed since the beginning of its creation, neither is disk D.
If I moved the data files and transaction log files to disk D, I'm able to attach the database.
How can this be?

Thank you,

Bernaridho

SQL Server 2019 Ukrainian_100_CI_AS_SC_UTF8 with "ьЬ" simmbol ( char 252 and 220 in Ukrainian codepage)

$
0
0

The last two lines will not return anything. For all other letters of the Cyrillic alphabet, this is not the case.
This is an old discrepancy in the Ukrainian_100_CI_AS encoding and similar.
Perhaps in UTF8 it is worth changing the behavior as in SQL_Ukrainian_CP1251_CI_AS?

 

select serverproperty('Collation')
exec sp_helpsort

create table #x (
a varchar(10) collate SQL_Ukrainian_CP1251_CI_AS
, b varchar(10) collate Ukrainian_100_CI_AS_SC_UTF8
, c varchar(10) collate Ukrainian_100_CI_AS
)

declare @x varchar(2) = char(252) + char(252) --ьь
declare @y varchar(2) = char(252) + char(220) --ьЬ

select @x, @y

insert into #x select 'ьЬ', 'ьЬ', 'ьЬ'
select * from #x where a like '%ьь%'
select * from #x where b like '%ьь%'
select * from #x where c like '%ьь%'

drop table #x

------ RESULT:

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

SQL_Ukrainian_CP1251_CI_AS

(1 row affected)

Server default collation

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

Ukrainian, case-insensitive, accent-sensitive, kanatype-insensitive, width-insensitive for Unicode Data, SQL Server Sort Order 108 on Code Page 1251 for non-Unicode Data


---- ----
ьь   ьЬ

(1 row affected)

(1 row affected)

a          b          c
---------- ---------- ----------
ьЬ         ьЬ         ьЬ

(1 row affected)

a          b          c
---------- ---------- ----------

(0 rows affected)

a          b          c
---------- ---------- ----------

(0 rows affected)

How To: Access Office 2008 Accounting DB after machine name change

$
0
0

We had a domain machine lose its trust relationship with the DC in our SBS 2011 domain. After several attempts at a fix, an admin had to disjoin/rejoin the machine to the domain. In the process he decided to change the machine name. After this, our Office 2008 accounting db's won't open.

We can see them in SQL Server Manger (2008 R2), but we can't access them via Office 2008 Accounting.

Is there some way to tweak the permissions on the db so that we can open them up again?

Thanks for any advice!

Sy Computing

Linked Server pointing to Informix DB

$
0
0

Hello guys,

I have a Linked Server pointing to Informix DB. Using this linked server I am writing OPENQuery SQL to fetch the data and load in SQL  table.

eg- SELECT*FROM OPENQUERY(TEST,' SELECT * FROM dbo.DimCustomer')

If I write a SELECT  statement using OPENQUERY method, I can view the data on the SSMS , but there are some tables exist which is throwing datatype overflow error. For a table I identified  the  column which is causing the issue.

Could not convert the data value due to reason other than sign mismatch or overflow

If I exclude this column SELECT statement returns the result without any issue. 

I analyzed this column which is varchar datatype and all the values looks good to me. there is no any garbage or abnormal value.

Do anyone having any idea about it.

Regards,

Avhilash


restrict login

$
0
0

Hi,

We are using SQL Server 2012.

We are using third party tool for backup and restores. For this purpose, we have a backup login in SQL server which has sysadmin privilege as it is required. I dont want this user to login into database using ssms.

Please let me know how to prevent this to access the ssms without creating any additional database.

Thanks

  




deploying windows form application with mdf database on any client pc machines

$
0
0







what are the file required to be deployed with my .mdf database so that it can work and install in any pc machine? thanks in advance


Track table last used/accessed by user sql

$
0
0

how to identify a table last accessed by  user/login details? need the name of the user

i can track last usage by ,

(last_user_seek),(last_user_scan),(last_user_lookup),(last_user_update)) as all_val(last_user_dt))  as access_datetime FROMsys.dm_db_index_usage_stats

High memory usage

$
0
0

Hello ,

I am facing one issue. In my system  5 SQL instances running on Two server Failover Cluster. ( SQL 2012).Total 80GB RAM.I have allocated RAM each instance.

One of the instance assigned Max Memory is 20GB RAM.Now Clientunable to  run even simple reports on that instance ,they are facingSystem.out.of memory issue. In this Instance existing only one database.Database Size around 65GB.

I have checked database utilizing 6GB Memory.

Please provide me the solution and how to release the memory.


Please check the below memory consumption report

Login maps to database user dbo

$
0
0

I have the issue of a user who is configured to have the dbo user set for their database login.

I understand that this can be simply fixed by running:

EXEC sp_changedbowner 'sa', 'true'

However, I want to search out any other occurrences of this across many instances with many databases.

I am happy to write code to script this but I don't know where to get the information that tells me that a user is mapped to the dbo user. Note, not as the default schema.

Would someone please identify what table(s) I need to use to obtain this information.

Viewing all 15872 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>