|
I have a database(Eg. SALES) in SQL Server 2014 which needs to be recreated in SQL Server 2012 version. Since I can not use the SQL 2014 back up file in SQL 2012 environment, I have proceed with the Generate Script option and trying to run the script in SQL Server 2012 environment. However it is giving an error as Msg 102, Level 15, State 6, Line 1
Incorrect syntax near 'DELAYED_DURABILITY'. which is pointing to the ALTER DATABASE [SALES] SET DELAYED_DURABILITY = DISABLED line in the script and not able to proceed further. Please help me to get this sorted out.
Thanks,
KV
|
|
|
|
|
As mentioned in the Lounge, remove that setting as it is new to 2014.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I have a database(Eg. SALES) in SQL Server 2014 which needs to be recreated in SQL Server 2012 version. Since I can not use the SQL 2014 back up file in SQL 2012 environment, I have proceed with the Generate Script option and trying to run the script in SQL Server 2012 environment. However it is giving an error as Msg 102, Level 15, State 6, Line 1
Incorrect syntax near 'DELAYED_DURABILITY'. which is pointing to the ALTER DATABASE [SALES] SET DELAYED_DURABILITY = DISABLED line in the script and not able to proceed further. Please help me to get this sorted out.
Thanks,
Kala
modified 5-May-14 14:45pm.
|
|
|
|
|
You are in the wrong forum!!!
Welcome to the Lounge
Technical discussions are welcome, but if you need specific help please use the programming forums.
DELAYED_DURABILITY is a 2014 only - new - feature, so 2012 do not know it...Change database compatibility to 2012 (110) and try again...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Correct and Correct. +5
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Didn't notice the forum. Thank you.
KV
|
|
|
|
|
|
Lloyd Atkinson wrote: I don't know what the equivalent is in 2012. It is empty string.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
As far as I know, there is no such property DELAYED_DURABILITY in SQL 2012. Hence removed that line and ran the query, it works fine. Not sure if this is the right approach, but just tried it out.
Thanks,
KV
|
|
|
|
|
There is not such property. Removing it is just right...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
Thank you Kornfeld Eliyahu Peter.
KV
|
|
|
|
|
hi,
I want to have fields in MySQL such as is_administrator, is_active, is_blocked which will be true or false, yes or no, negative or positive, or whatever name you'll use for it..
I would like to ask what's the best field type to use for such requirment?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
Depends on your version.
But I'd suggest bool, bit or tinyint, depending on availability in your version.
|
|
|
|
|
Jassim Rahma wrote: I would like to ask what's the best field type to use for such requirment? What's the reason you're asking?
In MySQL[^], TINYINT(1) = BOOLEAN = BIT
A value of zero is considered false. Nonzero values are considered true.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi All,
I want to use Non in on two columns like for example I am importing Prod Cost from some history table of xml imports (example Orders table). For that what am I doing is, taking the values from Orders table in to Temporary table which have to be imported. Then I am planning to import the values from this Temp table into our ProdCost table, which do not exist for in ProdCost table for the year as well.
Like I want to use Select * from #Temp Where (year, ProdId) not in (Select Year, ProdId from ProdCost). Is there any way to do this in SQL Server?
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Try this where clause.
Where not exists (Select * from ProdCost where Year = #Temp.Year and ProdID = #Temp.ProdID)
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
hi
i have written 3 different select query in mysql based on yesterday,today, tommorow dates to get the birthday details as follows
select concat(name,', ',title) as 'Yesterday 30-04-2014' from personal_details where DOB=curdate() - interval 1 day
select concat(name,', ',title) as 'Today 01-05-2014' from personal_details where DOB=DATE(NOW())
select concat(name,', ',title) as 'Tommorow 02-05-2014' from personal_details where DOB=curdate() + interval 1 day
how to join all 3 query results to one, i need to show as below
Yesterday Today Tomorrow
aaaa gggg nnnnn
bbbb hhhhh mmmm
dddd jjjjj
eeee
ffff
How to achieve this, i am not able to do.
If i tried with join there it wont match any condition and will not work because in each query result i will get unique values.
I tried with another query by putting as below
select a.* from (select CASE DOB WHEN (curdate() - interval 1 day) THEN concat(name,', ',title) ELSE '' END AS 'Yesterday', CASE DOB WHEN (DATE(NOW())) THEN concat(name,', ',title) ELSE '' END AS 'Today',CASE DOB WHEN (curdate() + interval 1 day) THEN concat(name,', ',title) ELSE '' END AS 'Tomorrow' from personal_details ) as a where a.Yesterday IS NOT NULL and a.Today IS NOT NULL and a.Tomorrow IS NOT NULL
It is showing the result like in all the three column some rows will be null
I dont want null values in any column. i want out as above.
How to achieve this. If anybody knows please reply me.
Thanks in advance.
|
|
|
|
|
Firstly to add your 3 queries together to act as a single result set you should look into the UNION[^] keyword.
To organise the layout so that the column headers become Yesterday, Today and Tomorrow you need to look into PIVOT[^] this example should show you how to create one.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
if i use UNION i will get one column result. I should get 3 column but without null values.
How to achieve this
|
|
|
|
|
how to fetch a table column of same name of more than 4 different database in sql server 2008r2???
|
|
|
|
|
When you create a complex SQL query with a large number of joins you may get into the problem of same column names in different tables. To assign a name of your choice to any of the returned columns you may use the format of
table.field as my_field_name
It is irrelevant from where the tables are as long as you can link to those databases - do you have problem there?
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
I'm working on an application for a joint-stock company.
A joint-stock company is a business entity which is owned by shareholders. Each shareholder owns the portion of the company in proportion to his or her ownership of the company's shares (certificates of ownership). This allows for the unequal ownership of a business with some shareholders owning a larger proportion of a company than others. Shareholders are able to transfer their shares to others without any effects to the continued existence of the company.
Shares are collected in a form of a deed. A deed has classes like a deed of 50, a deed of 40 and so on.
50 and 40 means that a deed consists of 50 shares, 40 shares and so on.
A joint-stock company may have a 1000 shares that are distributed in the form of deeds. each deed has a start share number and an end share number for example lets take a deed of 50 shares so its shares will start from share no. 1 to share no. 50.
Within the database of the company there is a table to store the information of each deed
DEED (DEED_NUMBER, START_SHARE, END_SHARE) if we use the previous example of deed of 50 and lets say that the deed number is 100. So the data will become 100 for DEED_NUMBER, 1 for START_SHARE, and 50 for END_SHARE.
What I need is to get all the numbers between 1 and 50 and this will be applied to all the deeds. So if I had a 1000 shares distributed in deeds I need to get the numbers 1, 2, 3, 4, .... 1000.
I already used a cursor to make such solution through looping on all deeds one at a time getting its start share number and its end share number and get all the numbers between them. However, this solution taking too much time and with a company like the one I'm working on having more than 100,000 to 150,000 deeds the time my solution takes to retrieve shares numbers is unbearable and unacceptable.
Thanks for any help and I'm sorry for long post I just wanted to explain what is the mean of joint-stock company so people know what I want.
|
|
|
|
|
Since a physical number isn't assigned to a deed, you probably don't really need the type of solution you are looking at. What you probably want is to say, "What deed has stock #501?" You can quickly get that from a simple DB query, if all of the stocks are put in with first and last stock numbers. Something like Select deed from deeds where START_SHARE <= number AND END_SHARE >= number. Sorry that probably isn't the exact syntax - it's been a while since I worked with a DB. But it might get you started.
|
|
|
|
|
I need to show the user all numbers of shares he has within his organization. He will use such shares numbers in viewing a report for people who has for example shares lies between share number 20 and share number 350, he will need to know who are the people owns those shares. I hope my idea become more clearer 
|
|
|
|
|
You haven't said anything that makes me think you REALLY need a master list of every single share, and who owns them. You can query the DB for all the deeds within a range, and then create a list from there in a relatively simple fashion. Good luck with the problem!
|
|
|
|