I don’t think it can be done with a single t-sql command. If you look at the script Management Studio creates when you change the ‘Is Identity’ property of an identity column, you will see that it needs to create a temporary table, drop the original table, and then rename the temporary table. -CarlosDL —————— [...]
SQL Server Integration Services. Import/export data from/in different data sources.
If you are on SQL SERVER 2005 or above, you could use a query like this: <pre> SELECT * FROM (SELECT id,year,col1,col2,ddate, ROW_NUMBER() OVER (partition by year ORDER BY ddate DESC) rowNumber FROM yourTable) ordered_temp WHERE rowNumber = 1;</pre> If you are not using SQL SERVER, or you are using an older version, please provide [...]
It sounds like you want all of the duplicates in A regardless of the duplicates in B <pre> select * from table1 where flda in( select flda from table1 group by flda having count(*) > 1) </pre> ————- If I understand correctly, I think you would have to add an additional condition to the query [...]
That is normal. The user aaa doesn’t have the rights needed to see if the service is running or not. The user would need to try to connect to the SQL Server to see if it is running. In order to see if the SQL Server is running the user would need to have very [...]
Open the SQL Server Business Intelligence Development Studio and create a new SSIS project. Add a data pump task. Add a source object as being the AS/400 and a destination as being the SQL Server. Select the objects to copy. When you run the package the data will be copied to the SQL Server.
Are you trying to use ADO.NET to connect from PowerBuilder to SQL Server 2008? What’s the connection string that you are using?
This <a href=”http://msdn.microsoft.com/en-us/library/ms170363%28SQL.90%29.aspx”>MSDN article</a> outlines the new items.
Try something like this: <pre>SELECT “T16.CPRP”.CP_DISTRICT_CODE, CASE “T16.CPRP”.CP_DISTRICT_CODE WHEN ‘xx’ THEN SUM(“T16.CMCL”.MC_TAX_AMOUNT) AS TOWN WHEN ‘yy’ THEN SUM(“T16.CMCL”.MC_TAX_AMOUNT) AS TOWN ELSE SUM(“T16.CMCL”.MC_TAX_AMOUNT/2) AS TOWN END, SUM(“T16.CMCL”.MC_TAX_AMOUNT/2) AS COUNTY</pre> (Replace ‘xx’ and ‘yy’ with the special district-codes which shall not be divided. And let the rest of your code remain. Happy coding ————————————— It could be [...]
Sorry, I wasn’t reading closely. RUNSQLSTM is not a JCL command, I was thinking CL. ——— JCL & SQL & DB2 – are we talking MVS? To exec dynamic DB2 SQL statements in a batch job (JCL); try using DSNTEP2 : <pre> 001720 //** 001800 //STEP1 EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=EVEN 001810 //SYSPRINT DD SYSOUT=* 001900 //SYSTSPRT DD [...]
I would assume that at some point either there weren’t any log backups being taken, or someone did a lot of data moving one day. Either way, if you aren’t running low of space, don’t bother shrinking the log file. You won’t gain anything by having a smaller transaction log file. Change the growth from [...]
More information would be helpful. In a nutshell you’ll need to use SQL Server Integration Services (SSIS) to do the work. On your workstation (or the server) install the AS400 drivers. Then open the Business Intelligence Development Studio (BIDS) and create a new SSIS package. Then use a data flow task to copy the data [...]
Your answer is in <a href=”http://technet.microsoft.com/en-us/library/cc720671%28WS.10%29.aspx”>this</a> MS tech article.
<a href=”http://msdn.microsoft.com/en-us/library/system.drawing.image.aspx”>System.Drawing.Image</a> <a href=”http://msdn.microsoft.com/en-us/library/system.io.memorystream.aspx”>System.IO.MemoryStream</a> <a href=”http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparameter.aspx”>System.Data.SqlClient</a> Use the Image class to get the file in to an image object. Use the Save method of Image to save it to a memory stream in jpeg format User memory stream’s .toarray function to convert it to a byte array. Assign your database command object a parameter with [...]
Here is how you can store you connection string in the app.conf and retrieve it at run time. http://msdn.microsoft.com/en-us/magazine/cc163812.aspx
I would take Carlosdl advise and read up. Here is how I would do this: CREATE TABLE department( departmentId INT NOT NULL PRIMARY KEY AUTO_INCREMENT, departmentNumber VARCHAR(16), departmentName VARCHAR(64) NOT NULL, isEnabled TINYINT NOT NULL ); CREATE TABLE course( courseId INT NOT NULL PRIMARY KEY AUTO_INCREMENT, departmentId INT NOT NULL, courseNumber VARCHAR(16), courseName VARCHAR(64) NOT [...]
Here is the function I wrote and use in my code. You will need to Import System.Net and System.Net.Mail at the top of the page you put it in. Below the code is the link to the reference pages for these two classes. <pre> Private Function SendMail(Server As String, User As String, Password As String, [...]
Worked with microsoft. They found this: http://social.msdn.microsoft.com/Forums/en-US/innovateonoffice/thread/b81a3c4e-62db-488b-af06-44421818ef91?prof=required Simply had to add this folder. C:WindowsSysWOW64configsystemprofileDesktop
Imports System.Data.SqlClient Sub SaveData(Name As String, Surname As String, Email As String, Comments As String) Dim cn As SqlConnection Dim cmd As SqlCommand Dim intResult As Integer cn = new SqlConnection(“Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;”) cmd = new SqlCommand(“”, cn) cmd.CommandText = “INSERT INTO table_name(name, surname, email, comments) VALUES(‘” & Name & “‘, ‘” & Surname [...]
A little research into T/SQL on <a href=”http://itke.techtarget.com/sql-server/”>my blog</a>, or on <a href=”http://SearchSQLServer.com”>SearchSQLServer.com</a>, or on <a href=”http://SQLServerPedia.com”>SQLServerPedia.com</a> –msi77– You can find a lot of questions on <a href=”http://www.sql-ex.ru/”>SQL Exercises</a>.





