Tag: sql-server-2012

Select into statement where source is other database

How to copy data from one DB into another DB with the same table structure and keep the key identities? I use Sql Server 2012 “Denali” and I want to copy some data from a Sql Server 2008 DB. The tables I have are exactly the same but I want the data from the old […]

Export values from SQL Server to txt file

I want to export values from SQL Server to txt file. I know about BCP, there I need to give either query or table name to export data from a table. I don’t want to export data but I want to export values that are assigned to variable. How can I do that, any help?

SSRS 2012 Charts Not Rendering

We recently upgraded to SQL Server 2012, and after a reboot a couple of nights ago, all of our charts have stopped working. All charts in various reports are now showing as a broken image with a red ‘x’ in the top left corner when I try to view them from report viewer controls. This […]

Visual Studio 2012 Database Designer – Has the functionality changed?

I recently installed Visual Studio and SQL Server 2012. I’m wondering if I’m missing something because the Database Designer doesn’t seem anywhere as friendly as the old version. In Visual Studio 2010 when I created a SQL User Instance (.mdf) in the App_Data directory, I was able to create tables using a nice interface that […]

NOCHECK does not disable foreign key references

Table creation script: CREATE TABLE [dbo].[details]( [id] [int] NULL, [details] [varchar](max) NULL ) CREATE TABLE [dbo].[name]( [id] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL, [name] [varchar](max) NULL, CONSTRAINT [PK__name__3213E83F0D384EE4] PRIMARY KEY CLUSTERED ( [id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON […]

Determine whether SP Parameter has a Default Value in T-SQL

Is there any way to determine from within SQL Server (I’m on 2012 FYI) if a SP’s parameters have default values? There are other threads on this, however the suggestions don’t seem to get me this information accurately. Here are a couple of things I’ve tried; select * from sys.objects so join sys.parameters sp on […]

Amazon RDS – are there workarounds to change a database time zone in SQL Server?

Amazon recently announced support for time zone change in Oracle RDS. Since this is still not supported for Microsoft SQL Server 2012, are there any workarounds, to obtain functionality similar to changing the whole database time zone?

UTF-8 Support, SQL Server 2012 and the UTF8String UDT

Researching the pro’s and con’s of SQL Server’s VARCHAR vs. NVARCHAR for my particular application, I came to the realization that it would be ideal if SQL Server supported UTF8 natively. Several SO posts indicate that it does not, e.g.: Is VARCHAR like totally 1990s? What are the main performance differences between varchar and nvarchar […]

Alphanumeric Sort

I need quick help in sorting data at SQL side. I am using Sqlserver 2012 (good if answer give with the new feature). I already search some links as Sorting in alphanumeric , Alphanumeric string Sorting in Sqlserver – Code project. But does not give the desired result. Still What I have try : CREATE […]

How to make calculation on time intervals?

I have a problem ,i solve it but i have written a long procedure and i can’t be sure that it covers all the possible cases . The problem: If i have a main interval time (From A to B), and secondary interval times (Many or no) (`From X to Y AND From X` to […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.