Microsoft SQL Server

159K

Solutions

49K

Contributors

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi Experts,

I would like to transfer over a DB to someone.
1-What is the command to execute to make a bak of that file to a given destination?
2- Will that person be able to restore that db without having my login/pwd?
3- In order to create that backup I had to run the following (as all views were converted by the import utility as tables with the view's names..)
select 'sp_rename ''['+name+']'', '''+replace(name,'view_','')+''';'+ char(10)+CHAR(13)+ 'go' + char(13) from sys.tables where type='U';

Open in new window

However the I had to go to every single line and click enter before the GO, how can I avoid that?

Thanks in advance
0
Get real performance insights from real users
LVL 1
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

hi,

I have gridview. chexbox is inside gridview. its giving an error when there is no data . Checkbox ix a bit field. How to resolve it.

  <asp:TemplateField HeaderText="Status"  HeaderStyle-HorizontalAlign="Left"   >
             <ItemTemplate>
                  <asp:CheckBox ID="lbIsActive" Enabled="false" runat="server"  Text="" Checked='<%# Eval("IsActive") == DBNull.Value ? false :  Eval("IsActive") %>' /> Is Active?
             </ItemTemplate>
             <EditItemTemplate>
                 <asp:CheckBox ID="rdIsActive" runat="server" Text="" Checked='<%# Eval("IsActive") == DBNull.Value ? false :  Eval("IsActive") %>'/> Is Active?
             </EditItemTemplate>
            <FooterTemplate>
                 <asp:CheckBox ID="inIsActive"  runat="server"  /> Is Active?
        
            </FooterTemplate>
         </asp:TemplateField>


c#
   protected void Page_Load(object sender, EventArgs e)
    { 
            if (!IsPostBack)
            {
                LoadAllApplications();
            }
}

   protected void LoadAllApplications()
    {
        try
        {
            AppAccessDataLayer obj = new AppAccessDataLayer();
            DataSet ds = obj.GetAllApplications();

            int count = ds.Tables[0].Rows.Count;
            if (ds.Tables[0].Rows.Count > 0)
            {
                gridView.DataSource = ds;
                gridView.DataBind();
            }
            else
            {
                

Open in new window

0
It's time to update sql server.  But I can't access the databases on this instance of sql server 6.5.  See image for error.  Notice there is a green light, but when I try to expand, I get the error.  Interestingly, the legacy program that is associated with the databases on this instance runs just fine.  Any ideas how I can get to the data via enterprise manager?
error message
0
I have a program that uses sql server database.  When I try to log in the first time it gives me a Login timeout expired window.   I click ok and then try to login again and it works.  Any ideas how to fix this??
0
I can not send mail through the SMTP connection manager (send mail task). System.net.webexepction

attched file
www.png
0
Hi,

Previously I was able to make use of an sysadmin account on our client's server to create jobs and execute packages. The client has now changed the rights of this account so it's not a sysadmin anymore and now the jobs are failing. They don't want to give me another sysadmin account. I now need to know how do I go forward in giving this new account permissions to run Sql Server Agent jobs and to execute packages. The account they have created for me is not a windows login but only a sql login.

Regards
Christian
0
Hi Guys,

I have got two databases on a server. Both of them have got the same amount of data, structure and stored procedures are also the same. One is for my internal testing and the other is for the dev testing.

For some reasons the same query on dev testing database calle (Spaces_SBDeployment) is very slow as compared to my own dev/test database (Spaces).

Please find below the images of the query execution results and time taken from both the databases using the same stored procedure.

This is the shared dev database which is very slow takes 21 seconds to bring back results
Shared dev database
This is the database for my own dev/test  takes 3 seconds to bring back the results for the same query and from the same amount of data
Internal dev/test database
Kind regards
0
Hi there.

I moved a web database app from a standard webhotel with classic asp and MySQL to a dedicated Microsoft server with SQL Server. There is a login page that check the user credentials in a database table in order to proceed. That used to work fine on the standard webhotel.
Now it won't work. I created a user that works fine in SQL Server Management. I used a standard connection string and included it in the login page. The page loads fine, but then the user credentials is submitted, then I just gives a blank page. Nothing to see in F12. I suspect that there may be an issue with some port permissions.
Anyone out there who knows what port that should be open and how to open it? Any  other suggestion to solve this problem?

Best regards

Ulrich
0
I Created a WebGrid using MVC but when i try to run I am getting this Error Message "SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.", I Checked SQL Server Logs but it is not even Connecting the Database, It is timing out after 1 minute, I Included these Timeouts but it is not working, Please help.
binding name="basicHttpBinding"  				 
closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" 
sendTimeout="00:10:00"

Open in new window

2
hi,

I am studying diff in Oracle and MS SQL, do they have any connection limit?
0
Get free NFR key for Veeam Availability Suite 9.5
LVL 1
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

I am trying to create backpac on sql server 2012 db.
I get this error.
I am confused by this, as I don't understand what is wrong that I am getting these errors. It is a simple db.

TITLE: Microsoft SQL Server Management Studio
------------------------------

One or more unsupported elements were found in the schema used as part of a data package.
Error SQL71564: The element Extended Property: [dbo].[InvoiceHeader].[PFCustomerOrderNumber].[MS_Description] is not supported when used as part of a data package (bacpac).
Error SQL71564: The element Extended Property: [dbo].[OrderHeader].[AmazonPO].[MS_Description] is not supported when used as part of a data package (bacpac).
Error SQL71564: The element Extended Property: [dbo].[OrderLine].[ASIN].[MS_Description] is not supported when used as part of a data package (bacpac).
Error SQL71564: The element Sequence: [dbo].[RC01_TransactionID] is not supported when used as part of a data package (bacpac).
Error SQL71564: Table Table: [dbo].[RC01_Sheet1] does not have a clustered index.  Clustered indexes are required for inserting data in this version of SQL Server.
Error SQL71564: Table Table: [dbo].[PF_Sales_Orders] does not have a clustered index.  Clustered indexes are required for inserting data in this version of SQL Server.
Error SQL71564: Table Table: [dbo].[OrderImport_1] does not have a clustered index.  Clustered indexes are required for inserting data in this version of SQL Server.
Error SQL71564: Table …
0
Hey all I have the following SQL Query that I am using in order to get comma separated values from a cell:

WITH cte AS(
    SELECT        
        uT.id AS UID, 
		uT.employeeID, 
        uP.type, 
		pP.name 
    FROM 
		usersTbl AS uT
    CROSS APPLY 
		dbo.DelimitedSplit8K(uT.userPerms,',') AS uPcommaItems
    INNER JOIN 
		usersPermissions uP ON uP.id = uPcommaItems.Item
	CROSS APPLY 
		dbo.DelimitedSplit8K(uT.userPermPages,',') AS pPcommaItems
    INNER JOIN 
		pagePermissions pP ON pP.id = pPcommaItems.Item
)
SELECT DISTINCT 
	UID, 
    employeeID,
    STUFF(
			(
				SELECT 
					',' + stuff1.type
				FROM 
					cte AS stuff1
				WHERE 
					t.UID = stuff1.UID 
				FOR XML PATH(''), TYPE
			).value('.', 'NVARCHAR(MAX)'), 1, 1, ''
		  ) AS userPermissions,
	STUFF(
			(
				SELECT 
					',' + stuff2.type
				FROM 
					cte AS stuff2
				WHERE 
					t.UID = stuff2.UID
				FOR XML PATH(''), TYPE
			).value('.', 'NVARCHAR(MAX)'), 1, 1, ''
		  ) AS pagePermissions
FROM 
	cte AS t

Open in new window


The userTbl table looks like this:
------------------------------------------------
ID    | employeeID | userPerms | pagePermPAges
------------------------------------------------
15    | 3FdFieu9I  | 1,3       | 1,4,5,6

Open in new window


The userPermissions table looks like this:
----------------
ID | type
----------------
1  | Read
2  | Write
3  | Upload
4  | Admin

Open in new window


And this is my pagePermissions table looks like:
----------------
ID | name
----------------
1  | bindex
2  | flight
3  | submit
4  | form
5  | information
6  | myPage
7  | register

Open in new window


My current output of the query above is this:
-------------------------------------------------------------------------------------------------------
ID    | employeeID | userPermissions                         | pagePermissions
-------------------------------------------------------------------------------------------------------
15    | 3FdFieu9I  | Read,Read,Read...upload,upload,upload...| Read,Read,Read...upload,upload,upload...

Open in new window


It should read this though:
-------------------------------------------------------------------------
ID    | employeeID | userPermissions | pagePermissions
-------------------------------------------------------------------------
15    | 3FdFieu9I  | Read,Upload     | bindex,form,information,myPage

Open in new window


Any MS SQL guru out there that can help me out?
0
We have a server 2008 R2 server with SQL server 2008 R2, running 16 GB of memory, 64 bit OS, Xeon X340 @ 2.4Ghz.

All resources are funnelled towards the SQL application, we seem to have intermittent slow down and performance issues where the Disk queue jumps up to 2.95, IO is 10 MB/Sec

System PID 0 is using the most total Bytes per second of: 8,720,200

Heaviest disk IO is the SQL application itself.

This only seems to happen sporadically two or three times a day, and I haven't been able to correlate it to any specific task or backup job running during that period of time.


This SQL server services multiple sites with users directly accessing the database (no terminal server or replication to local SQL). And all users are affected by the performance issues.

The disk speed is 7200 RPM and the server hosting them is from 2010.

Any ideas?
0
I have a sql statement that subtracts two numbers:
CASE ALLOCATED WHEN NULL  THEN QTY_ON_HAND - ALLOCATED ELSE QTY_ON_HAND END AS On_Hand_Less_Allocated

Qty on Hand    Allocated   On_Hand_Less_Allocated
10                        6                       4
4                          6                       2  (should be -2)

What am i doing wrong?
0
Hi EEE:


I have a dataset of units being bought and/or sold. The deal ID is determined by column D and you may buy and sell units under the same deal. Column E is just some descriptive for the deal.  

Original dataset

D  E  BS B_VAL  S_VAL

d1 e1 B  200  null
d1 e1 S  null 100
d2 e2 B  500  null


Evaluate if B_VAL > S_VAL given same D then return one row only but with BS as B and keep both the B_val and S_val on the same row.

d1 e1  B 200 100
d2 e2  B 500 null
0
Hi out there.

I have a - supposedly - basic issue.  I have a SQL/web-server with a general login for myself. If I use that in a connection string, it doesn't work. I wonder if I need to create a login/user via the SQL Server Management Studio?
Can anyone please give me a quick guide how to create a user/login I can use in a connection string like this:

"Driver={SQL Server};Server=SERVERNAME\SQLEXPRESS;Database=databasename;Uid=username;Pwd=password"

Thank you.

Best regards

Ulrich
0
Hello,
How can i add a field in a table  at particular position.

Is it possible to avoid dropping the table and recreating it.

Regards
0
Hi ,

Please provide detailed procedure for In-Place Up-gradation from MS SQL Server 2012 to MS SQL Server 2014 include MSBI Components like SSIS Packages, Cubes/OLAP Databases and SSRS Reports.

Please consider this high priority.

Thanks,
Chandra
0
Hello Experts

I have developed a package that works very well in development. I do 2 things
1. I publish it to the SSIS server
2. I call you through a job

In the execution of the job falls for a subject of permissions
This is the error
Error: 2017-08-12 13:53:28.56
   Code: 0xC0016016
   Source: DWH 
   Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Clave no v lida para utilizar en el estado especificado.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.
End Error
err_DTS.txt
0
Free Backup Tool for VMware and Hyper-V
LVL 1
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

I need the strings below to build properly...

As
'Name1','name2','name3'

This is not building correctly

IF @strTourStatus = ''
    BEGIN
        SELECT @strTourStatus = COALESCE(@strTourStatus + ',', '') + '''' + TourStatus + ''''
        FROM   (   SELECT DISTINCT TourStatus
                   FROM   everyware_t_tour WITH ( NOLOCK )
               ) pc;
    END;
0
Hey everyone, I'm looking for suggestions and/or different points of view.

My company is collaborating with an external vendor (different domain than mine), and in that effort we need to keep a updated copy of the vendor's database internally.  Currently, we are simply having the vendor take a full backup every night of their database, we transfer it electronically and then we are restoring that database internally.  We'd like to have our internal database refreshed more frequently than once a day however.  Our internal users need to have full control over the internal copy of this database.

We're using Microsoft SQL 2014 on all instances involved.

What is the best way of going about this with the following (perceived) limitations:
          1. Log Shipping - The database cannot be in "read-only" mode during business hours
          2. Backup and restore - This means we can only have a daily restore, as the database needs to be live all day
          3. Availability Groups - The instances involved are in different domains
          4. Replication - This functionality seems to have many deprecated features

In advance, thanks for any help,
Corey
0
I have a simple  .Net web form that submits to a SQL Server Stored Procedure

In the stored procedure I insert a persons data into the Individuals table

I am currently setting the following
DECLARE @IndividualID BIGINT
.... Insert form data to table.....

SET @IndividualID = @@Identity()

I then use that Variable to insert into additional sub tables
IndividualsToUsers
IntividualToAddress
etc...

Is @@Identity correct?
Or should it use Scope_Identity?

It also returns @IndividualID to the Form.
That is not used elsewhere but just with a If CInt(dR("IndividualID").ToString()) > 0
TO let us know the data was inserted with no error
0
convert month name to month number in sql server 2012
Eg : Aug means current yearand month (201708)
0
Every day we set up several company codes.  I want to find out when we will run out.
The company codes are 6 digit numbers, so will run out when we get to 999999.
The table has the company code and the createdate in YYYYMMDD format.
Therefore, it's easy to see how many codes are created each day.
How do I see how many have been set up in a week or a month.
I'm using SQL Server 2012.
0
Hi,

I am studying the pros and cons of multi site architecture of MS SQL, oracle, MySQL and sybase. I know about MySQL and I am focusing on MS SQL now.

other than AOG, anything else can be good for MS SQL on 2 x data center MS SQL configuration/topology ?
0

Microsoft SQL Server

159K

Solutions

49K

Contributors

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.