Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
rafeequddin_ahmed
Starting Member
23 Posts |
Posted - 2006-10-03 : 04:52:58
|
Hi,SET @SQL4 = N'EXECUTE ' + @nvcDatabaseName + N'.dbo.sp_executesql N''in the line above ,dynamic query is created,but why N is used here , what is the use of N in the above queryThank in advanced |
|
Kristen
Test
22859 Posts |
Posted - 2006-10-03 : 04:59:03
|
N'MyString' means that the MyString is in UniCode, rather than normal 8-bit ASCIIKristen |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
Kristen
Test
22859 Posts |
Posted - 2006-10-03 : 10:34:02
|
Actaully Madhi: isn't sp_executesql ONLY in master?Kristen |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-10-03 : 11:39:03
|
quote: Originally posted by Kristen Actaully Madhi: isn't sp_executesql ONLY in master?Kristen
Yes it is MadhivananFailing to plan is Planning to fail |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-10-03 : 12:56:53
|
But that's the beauty of sp_executesql. See what it does when you specify DBName.dbo.sp_executesql. It comes in handy for DBA scripts.Tara Kizer |
 |
|
Kristen
Test
22859 Posts |
Posted - 2006-10-03 : 14:05:16
|
Ha! Would never have thought of that ...Kristen |
 |
|
|
|
|