Viewing 15 posts - 301 through 315 (of 358 total)
No. I think they just need to find all objects such as views or sp's that contained the text Address.
June 14, 2008 at 12:08 pm
Try this.
Select TOP 1 ID, coalesce(Name,'')+ ';' + Name
FROM Table1
Where ID = 1
June 13, 2008 at 3:13 pm
Actually that will scan all databases. All you need is this.
select object_name(id) , [Text] from syscomments
where text like '%Address%'
June 13, 2008 at 1:06 pm
Try this.
CREATE TABLE #Tmp
(DatabaseName varchar(100),
ObjectName varchar(100),
Txt varchar(4000)
)
INSERT INTO #Tmp
EXEC(
'sp_msforeachdb''
USE ?
select ''''?'''', object_name(id) , [Text] from syscomments
where text like ''''%Address%''''
'''
)
Select * from #Tmp
Drop Table #Tmp
June 13, 2008 at 1:05 pm
In Enterprise Manager you have to highlight the column header by clicking the cell header.
June 13, 2008 at 10:02 am
The connection timeout is how long the app will wait to connect to sql. The command timeout is how long the command will wait for the query results.
June 12, 2008 at 6:23 pm
The second part is not in quotes.
'Create Table' + @[User::newfile] + '(
[First] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Middle] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
...
June 11, 2008 at 8:49 pm
You can increase your command timeout in the application.
dim cmd as sqlcommand
cmd.commandtimeout = 300
Or you can change it in the connection string.
data source=xxxx;initial catalog=xxxx;integrated security=SSPI;Connect Timeout=300;
June 11, 2008 at 8:41 pm
Try this.
insert into Table1 (a,b,c)
(select a,b,
CASE c WHEN NULL THEN ' ' ELSE c END
from Table2)
June 11, 2008 at 12:45 pm
Here is a sample of inserting from the table with the xml datatype to a parsed table.
INSERT INTO SERVERS(SerialNumber,Manufacturer,Model,SystemType)
Select
InventoryXML.value('(/Root/Server/SerialNumber)[1]','varchar(50)') SerialNumber,
InventoryXML.value('(/Root/Server/Manufacturer)[1]','varchar(50)') Manufacturer,
InventoryXML.value('(/Root/Server/Model)[1]','varchar(50)') Model,
InventoryXML.value('(/Root/Server/SystemType)[1]','varchar(50)')...
June 11, 2008 at 12:41 pm
Here is a sample that loads an xml file to a table with an xml column.
INSERT INTO InventoryFeeds (InventoryXML)
SELECT InventoryXML
FROM ( SELECT * FROM OPENROWSET ...
June 11, 2008 at 11:59 am
I dont think you need the server variable since you are already connected to that instance. That is what is causing the syntax error. You can not put...
June 10, 2008 at 7:12 pm
Create Table #Temp
(Script varchar(1000)
)
INSERT INTO #Temp
Exec sp_msforeachtable'
Select ''Alter Table '' + ''?'' + '' ADD CONSTRAINT '' + object_name(c.cdefault) + '' DEFAULT '' + t.text + '' FOR...
June 10, 2008 at 10:15 am
See if this helps.
Create Table #Temp
(TableName varchar(100),
ColumnName varchar(100),
DefaultName varchar(500),
DefaultText varchar(100)
)
INSERT INTO #Temp
Exec sp_msforeachtable'
Select ''?'' TableName ,c.Name, object_name(c.cdefault) DefaultName,
t.text
from dbo.syscolumns c
join dbo.syscomments t on t.id...
June 10, 2008 at 9:45 am
Viewing 15 posts - 301 through 315 (of 358 total)