Viewing 15 posts - 196 through 210 (of 346 total)
Since you are already using SSIS check these links for information on how to use the filesystem task to do the copying and renaming of files...
http://rafael-salas.blogspot.com/2007/03/ssis-file-system-task-move-and-rename.html
November 26, 2008 at 1:55 pm
This should work in management studio(don't know why you had the Rem in the SQL code part though)
DECLARE @rc int
DECLARE @dt varchar(8)
DECLARE @cmd nvarchar(1000)
November 26, 2008 at 1:48 pm
Since the bcp syntax is showing up there's an error in the syntax
Give a space between -S and the @@servername...i.e.
-S ' + @@servername (note the space between S...
November 26, 2008 at 10:26 am
1. Script:
delete from table1 where userid = ?
--Comments: Here ? = dynamically passed parameter
Just modify the existing code to take in an extra parameter...
2. Create a new job in SQL...
November 26, 2008 at 10:22 am
Couple of issues in the code you posted...
The stored procedure name is not fully qualified
There is a "," between -t and -T
declare @sql varchar(8000)
select @sql =...
November 26, 2008 at 9:03 am
This can be done using some dynamic SQL and querying the system tables or INFORMATION_SCHEMA views...sample code attached:
-- setup data
USE tempdb;
IF OBJECT_ID('dbo.TestTab1') IS NOT NULL
DROP TABLE dbo.TestTab1;
IF OBJECT_ID('dbo.TestTab2') IS NOT...
November 26, 2008 at 8:45 am
Let me know if this is what you were looking for....
USE tempdb;
IF OBJECT_ID('dbo.JobTestTable') IS NOT NULL
DROP TABLE dbo.JobTestTable;
GO
CREATE TABLE dbo.JobTestTable(SomeData nvarchar(100))
GO
INSERT dbo.JobTestTable(SomeData) SELECT 'SomeData'
SELECT 'BeforeJobRun',* FROM dbo.JobTestTable;
DECLARE @JobCmd nvarchar(1000);
DECLARE @srvname...
November 26, 2008 at 7:40 am
krayknot - the cursor solution you've provided is not the best approach. For most situations we don't need to use a cursor.
In the links that were provided are good examples...
November 25, 2008 at 3:11 am
Maybe there are two rows in the table to begin with - and your insert statement is just inserting both the records?
Maybe there's a trigger on the table c that's...
November 25, 2008 at 2:19 am
Also check http://databases.aspfaq.com/general/how-do-i-concatenate-strings-from-a-column-into-a-single-row.html for options on how to use FOR XML PATH to concatenate...
November 24, 2008 at 10:59 pm
Check SQL Server books online (BOL) for lots of details on collations, changing collations, accent sensitivity, code pages etc
Why exactly do you want to change the collations? Knowing this will...
November 24, 2008 at 3:15 am
As Tom mentioned - could you post the table structures?
It looks like one of the ID columns in one of the tables you are joining on is of varchar...
November 24, 2008 at 3:01 am
I'm assuming you are looking for something like this:
USE tempdb;
GO
IF OBJECT_ID('dbo.YearVw') IS NOT NULL
DROP VIEW dbo.YearVw;
GO
IF OBJECT_ID('dbo.YearTab') IS NOT NULL
DROP TABLE dbo.YearTab;
GO
CREATE TABLE dbo.YearTab(YearVal int, SomeOtherVal varchar(30));
GO
INSERT dbo.YearTab(YearVal,SomeOtherVal)
SELECT 2008,'Year2008'
UNION ALL
SELECT...
November 21, 2008 at 3:29 am
Using a loopback linked server with SET FMTONLY can help in getting the information...
Loopback linked server: http://geekswithblogs.net/urig/archive/2006/03/23/73132.aspx
I've attached some sample code - the original idea was something I found in...
November 19, 2008 at 8:13 am
You could also use the sqlcmd command line utility for this - you can specify either a path on the server or use a UNC path (as long as access...
November 19, 2008 at 2:22 am
Viewing 15 posts - 196 through 210 (of 346 total)