How to copy a store procedure one to another database in same server I work on a project. I want copy all or single store procedure from old financial year **db_17_18** to new financial year **db_18_19** I want to do it using sql server command. i try it but showing error Please help me.... i used : SQL_Server 2008 r2 server name : shop04 **What I have tried:** **try 1** select * into DB_18_19.dbo.P_Add_FY_Data.procedures from DB_17_18.P_Add_FY_Data.procedures WHERE type_desc='SQL_STORED_PROCEDURE' **Error1 :** Msg 117, Level 15, State 1, Line 1 The object name 'DB_18_19.dbo.P_Add_FY_Data.procedures' contains more than the maximum number of prefixes. …

Member Avatar
Member Avatar
+0 forum 3

I have a table that contains some cubes with servers and active status (see attached image): note: CUBE1 is repeated intentionally. The idea is the same cube is getting synced from the same server 1 as a data source (process_server) onto different target servers (query_server; say server2 is in region A and server 3 is in region B). The way the environment is set up is both servers have to be active/active status (meaning TRUE) except for some additional test cases, i am setting to false sometimes one or the other. I have the following script now calling the cube …

Member Avatar
Member Avatar
+0 forum 1

Hi Guys! I have a website but we don't host in GoDaddy or any hosting website, because we use SQL database. And we have a large database that we are using , the website is for productions. We store a lot of data. We use the IP address because we port forward it so that we can use it anywhere. Now, we are worried because we are exposing our IP address outside, and it might be the reason for hackers or any attacks to come to us. Can you help me or give me an Idea how can I change …

Member Avatar
Member Avatar
+0 forum 15

automatically duplicate rows in sql server 2008 r2 select query i have two table name 1) tbl_Stock_Journal 2) tbl_Stock_Journal_Details i run a select query with where condition i have 5 data in table1 and in table 2 have 3 data when i run the query result is showing 15 row the query show on date wise i want to maximum data show and if other table in same date have no number of data then show blank or null please help me..... ALter proc P_GetStockJournalRPT -- 'all', 'all','2018-07-10' , '2018-07-10' @SJItmID varchar (100) , @SJDItmID varchar (100) , @Sdate date, …

Member Avatar
Member Avatar
+0 forum 4

I am trying to select all rows from all tables in the database when a column equal a given name. I have like many tables with same structure and columns. I have written this piece of code but it throws an error. SELECT GROUP_CONCAT(qry SEPARATOR ' UNION ') INTO @sql FROM ( SELECT CONCAT('SELECT * FROM `',table_name,'` where Name like ''','sally%','''') qry FROM ( SELECT distinct table_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = 'db_customers' AND column_name LIKE 'Name' ) A ) B; PREPARE s FROM @sql; EXECUTE s; DEALLOCATE PREPARE s; This is the error I am getting. I am aware …

Member Avatar
Member Avatar
+0 forum 3

This is surprisingly difficult. Consider it a snippet. Deletes all tables from a sql server schema. Useful for those times on your dev machine where you need to tear down all the cruft that has built up on your server due to refactoring of object relationally mapped tables. --Author: Cameron Block DECLARE @SCHEMA VARCHAR(50) = 'cblock'; DECLARE @LOOP_PREDICATE INT = 1; WHILE (@LOOP_PREDICATE > 0) BEGIN DECLARE CUR_PARENTS CURSOR FOR select referenced_object_id "REF_ID", T.name "TABLE", S.name "SCHEMA" from sys.foreign_keys FK JOIN SYS.TABLES T ON T.object_id = FK.referenced_object_id JOIN sys.schemas s ON t.[schema_id] = s.[schema_id] JOIN INFORMATION_SCHEMA.TABLES I ON i.TABLE_NAME = …

Member Avatar
Member Avatar
+1 forum 2

hello i have oracle database 10g as my sql server. i didnt use it for over a year and now when i open it the page just closes without any warning or error after entering the username and password. i reinstalled it and the problem is still there. i can't find why it happened and how to solve it. please do help me.

Member Avatar
Member Avatar
+0 forum 1

Hi, I have a SQL Server (RSQL) and a SSAS Server(RSSAS). RSQL has a linked server to RSSAS, naming [LinkedCube] Here is a screenshot of my Linked Server Properties I use SSMS to connect to RSQL and then run a query that returns data from SSAS using linked server. The result set contains 100,000 rows and it took 17 seconds to return data completely. The Profiler said that MDX query duration is about 3 seconds, so it took 14 seconds to return data. The network connection has a maximum transfer rate at 100MB/sec, so 14 seconds is not acceptable. Do …

Member Avatar
+0 forum 0

I am a beginner in this field and I have some mistakes in ((codes)) who can tell me what my mistakes. Physical model (1) Employee (SSN, Salary, Phone) CREATE TABLE Employee (SSN integer PRIMRY KEY, Salary integer, phone integer); Department(DNO, dname, Budget, ssn_employee) CREATE TABLE Department(DNO integer, dname varchar(10 )Budget Integer, ssn_employee int, CONSTRAINT pk_Department PRIMARY KEY (DNO) ,FOREIGN KEY (ssn_employee) REFERENCES employee(ssn_employee) ON UPDATE CASCADE ON DELETE SET NULL ); Child(IDChild, Name, Age, ssn_employee) CREATE TABLE Child( IDChild Integer, Name varchar(40), Age Integer, ssn_employee Integer CONSTRAINT pk_Child PRIMARY KEY (IDChild), FOREIGN KEY (ssn_employee) REFERENCES employee(ssn_employee) ON UPDATE CASCADE ON …

Member Avatar
Member Avatar
+0 forum 4

I am having a table with nvarchar feild in which values are entered like 1 4 8 25 I want a sql query to find the missing sequence of number in the above series... Thanks in advance...

Member Avatar
Member Avatar
+0 forum 5

Hi, I am following a walkthrough of [Entity Framework Code First to a New Database](https://msdn.microsoft.com/en-us/library/jj193542(v=vs.113).aspx) Everything appears to go as expected right through to the end of step 4, where it says "We can now inspect the schema that Code First created." The database shows up under data connections in server explorer, (host\sqlexpress.CodeFirstNewDatabaseSample.BloggingContext.dbo) but there are no tables in it. What might I have done wrong? Thanks for reading.

Member Avatar
+0 forum 0

I am a beginner practicing how to create tables on SQL Here is what I've done: Create Table PO (Order_id int primary key, order_date date, customer varchar(1000)); Create table PO_Line_Item (Order_id int not null, Line_number int not null, Product varchar (30), Unit_Price decimal (10,2), Qty decimal (10,2), Tax decimal(10,2)); When I press execute it appeared "there is already an object named 'PO' in the database. What have I done wrong?? If any one have any ideas pls let me know

Member Avatar
Member Avatar
+0 forum 1

**problem** How to get cost per hotel and flight then add it in duration cost table based on flight date automatically . **Details** suppose i write flight date 26/07/2017 alexia 8days 04/08/2017 it must automatically get cost from hotel price table and price from flight then add it in duration cost table so that what query i write to get cost per hotel and flight when write flight date then insert it to duration cost table my database CREATE TABLE program( ProgramID int primary key not null, ProgramName varchar(30) ) GO insert into program values(1,'Alexia'),(2,'Amon'),(3,'Sfinx') GO CREATE TABLE ProgramDuration( DurationNo …

Member Avatar
Member Avatar
+0 forum 1

To all database genius out there, I hope you can help me with this error I encountered when importing excel file to SQL Server 2005. This is the error: [CODE]Executing (Error) Messages Error 0xc020901c: Data Flow Task 1: There was an error with output column "Description" (21) on output "Excel Source Output" (9). The column status returned was: "Text was truncated or one or more characters had no match in the target code page.". (SQL Server Import and Export Wizard) Error 0xc020902a: Data Flow Task 1: The "output column "Description" (21)" failed because truncation occurred, and the truncation row disposition …

Member Avatar
Member Avatar
+0 forum 14

I am trying to cast/ convert varchar to a numeric value. I have done this succesfuly when I eval the lower range, however I get an error when I do the upper range. this is my evaluation section that works. isnull(cast(measurmentdata.measvalue as numeric),0) < productinfo.lowerrange however when I try to test to see if it is above the upper range it throws an error isnull(cast(measurmentdata.measvalue as numeric),0) > productinfo.upperrange I have tried not between as well. while it does not return any errors it does not correctly test for > or < isnull(cast(measurmentdata.measvalue as numeric),0) not between productinfo.lowerrange and productinfo.upperrange

Member Avatar
Member Avatar
+0 forum 3

Hi friends , I have three table Countdown, Walk, Bon de reception The Id_marche is a foreign key in the countdown table and The Receipt table contains the Id_marche I want to insert in recordings in the counting table which contains Amount TTC so to calculate Amount TTC = TVA* Amount HT I have the TVA AND the Amount HT in the voucher table of reception I could not create a request to insert and calculate the amount TTC I do not know is what I described well my condition And thank you for you in advance

Member Avatar
Member Avatar
+0 forum 1

Hi, i have a db system where i fetch results from two tables. A user and transaction table. In the transaction table i have two columns which are sender and reciver id which refence in the user table. how do i get a sender name and receiver name in a query. Thank you.

Member Avatar
Member Avatar
+0 forum 1

I would like to show data in a table in SQL server database to Gridview in ASP.NET project, but the gridview shows nothing. Could you please help me to find where is the problem, and how to fix it. Thanks Here is my code: protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { string cs = ConfigurationManager.ConnectionStrings["SampleDBCS"].ConnectionString; SqlConnection con = new SqlConnection(cs); SqlCommand cmd = new SqlCommand("select * from newexample", con); DataTable dt = new DataTable(); dt.Columns.Add("col0"); dt.Columns.Add("col1"); dt.Columns.Add("col2"); con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { DataRow dr = dt.NewRow(); dr["col0"] = rdr["col0"]; dr["col1"] = rdr["col1"]; dr["col2"] = …

Member Avatar
Member Avatar
+0 forum 1

i have create a webpage using visual studio 2017. now how could i link this to database that i have created in mysql.?

Member Avatar
Member Avatar
+0 forum 1

hello, i have one table in sql server and i made a form to editing this table from. so when i click edit in the table .. it takes me to the editing form with the chosen id .. what i need is to show all other feildes in the form that related to the chosen id ???!! any help ?

Member Avatar
+0 forum 0

Hi all, I'm working on a SQL procedure to insert a row for new clients based on a template account that already exists in the database. I thought about Declaring a variable and selecting the value from the table one at a time, but with many columns needed, this seems inefficient. Sample Query: DECLARE @Template_Account decimal(10,0) = 8; DECLARE @Field1 ntext = (SELECT Field1 FROM cltClients WITH(NOLOCK) WHERE ClientNumber=@Template_Account) DECLARE @Field2 ntext = (SELECT Field2 FROM cltClients WITH(NOLOCK) WHERE ClientNumber=@Template_Account) DECLARE @Save1 bit = (SELECT Save1 FROM cltClients WITH(NOLOCK) WHERE ClientNumber=@Template_Account) DECLARE @Checkin1 bit = (SELECT Checkin1 FROM cltClients WITH(NOLOCK) …

Member Avatar
Member Avatar
+0 forum 3

Hello, I built a website on my personal server and everything work fine. But when I uploaded it on the production server there is a problem with the database - the character encoding is wrong so the text is unreadable (users submit greek words). The collation of the tables is **utf8_general_ci** and I've included the **meta charset="utf-8"** on all the pages. I've tried including **header('Content-type: text/html; charset=UTF-8');** or **SET NAMES UTF-8** but they didn't do anything. What did I do wrong? Thanks for your time.

Member Avatar
Member Avatar
+0 forum 1

Not sure if this is the right place for this, if not, please remove. I'm an Admin for a very large SAP landscape which includes variety of DBs. I've been evaluating the Xandria product from syslink ([www.syslinkams.com](http://www.syslinkams.com)) and so far been very impressed. I was wondering if anyone had any good/bad expereince.

Member Avatar
+0 forum 0

I am using the Ionic framwork for the mobile app and Bootstrap for the web app, this has been set by my University as what we have to use, so we can't change them, but is there a way to link the data base to both services? Thanks in advance Ashley

Member Avatar
Member Avatar
+0 forum 1

I inserted data in sql server using asp.net (MVC 5), and its flowing nicely, but my problem is this. I don't want to insert in sql the exist data. How can I do it?

Member Avatar
Member Avatar
+0 forum 11

Hello everyone, I need to open mdf file but I can't install SQL server. Please advise how to view data in sql mdf file? Thanks in advance, Richard

Member Avatar
Member Avatar
+0 forum 4

Hi, My Crystal Report is using VB.NET and Sql server 2005. The report can be displayed but everytime it will prompt me to key in the Username n Password.. is there anyway to automatically pass the login information to reports? thanks =)

Member Avatar
Member Avatar
+0 forum 12

Hello everyone! I have been working on my school project and I have encountered problem linking jTable with a table in the sql server.Can anyone please help me regarding it.Please help me with the code on how to link the the table.

Member Avatar
Member Avatar
+0 forum 2

I have a SQL Server bank account table which contains ... ID (Identity) Trdate (Date), Description (Varchar), Debit (Money), Credit (Money), Balance (Money) Details (Varchar) I want to list a subset of the transactions between two dates (the period of an Australian Financial year) and the query below works correctly Select ID, TrDate, Description, Debit, Credit, Balance, Details From Bank_Acct Where TrDate Between '2009-07-01' and '2010-06-30' Order By TrDate, ID but I want to also add into the result set another record at the beginning which is the opening or brought forward balance for that period and the query below …

Member Avatar
Member Avatar
+0 forum 2

Hi .. I have been asked to create a new thread rather than recurrent on old post ([url]http://www.daniweb.com/forums/thread116468-2.html[/url]), hope to get some help here... :) I would like to have a "Extract" button which then open a Save As dialog to save the file from the Database into local pc, the SqlFileHolder provided in [url]http://www.daniweb.com/forums/thread116468-1.html[/url] , work nice for me, but just wanted to have additional stuff by downloading the file. [CODE] private void saveFile(object sender, System.EventArgs e) { // open SaveFileDialog so the user can save the file SaveFileDialog saveFileDialog1 = new SaveFileDialog(); saveFileDialog1.Title = "Save File.."; saveFileDialog1.ShowDialog(); ... …

Member Avatar
Member Avatar
+0 forum 3

The End.